On Sun, 2 Feb 2020 at 19:19, Иван Комиссаров <abba...@gmail.com> wrote:
>
> Can we please return to the discussion about QObject parent/child with smart 
> pointers rather than discussing Qt/stl naming?
>
> No one answered my question about QObject::deleteLater:
>
> > And what about the QObject::deleteLater() method? Any ideas how this should 
> > look like with smart pointers?

For a unique_ptr, a deleteLater would take ownership and destroy the
moved unique_ptr on a different event loop round,
for a shared_ptr, a deleteLater would copy it and destroy the copy on
a different event loop round. The difference is
that you can't touch a unique_ptr after a deleteLater call, and if you
happen to hold on to a copy of the shared_ptr,
the deletion might not occur at all.
_______________________________________________
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to