The aim of these suggestions is not to change how memory management works in Qt, but to wrap it in a uniform syntax, and by the way, eliminate the need for explicit usage of `new`. We need to view each case of memory allocation that is used somewhere in Qt and think about how to express it in this syntax.
- Anton 2016-06-04 19:09 GMT+03:00 Nye <kshegu...@gmail.com>: > On Sat, Jun 4, 2016 at 6:48 PM, Konstantin Tokarev <annu...@yandex.ru> > wrote: >> >> 04.06.2016, 18:10, "charleyb123 ." <charleyb...@gmail.com>: >> > This is to free the developer from considering implications of (2). >> >> I disagree, (2) is still present as the choice of make-function. It's up >> to you to decide if it will be Foo(...), std::make_shared<Foo>(...), >> std::make_unique<Foo>(...), or something else. > > > Perhaps, however by using make_shared you're basically saying the object > manages its own lifetime and there's no notion of ownership transfer (i.e. > you can't tell all shared pointers to detach from that object at once). > This basically leads only to working around Qt's ownership system and > ultimately making trouble for yourself (e.g. this thread on the Qt forum > http://forum.qt.io/topic/66639/qcamera-stop-hangs-or-causes-a-crash-how-to-deinit-the-camera-properly > ). > > Kind regards. > >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest