]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/panel.h
Rework how widget ownership works in Container
[libs/gltk.git] / source / panel.h
index 3abfee1cadb072c74f9f0b4229fda6acfb98b6cd..3061032789574f168c2bb2933f787d4f439c1284 100644 (file)
@@ -117,8 +117,9 @@ void Panel::Loader::unnamed_child()
 {
        std::unique_ptr<T> chl = std::make_unique<T>();
        load_sub(*chl);
-       obj.add(*chl.get());
-       last_widget = chl.release();
+       Widget *wdg = chl.get();
+       obj.add(move(chl));
+       last_widget = wdg;
 }