]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/panel.cpp
Rework how widget ownership works in Container
[libs/gltk.git] / source / panel.cpp
index d4e737bee7de6e9b48ef459b02f35f111a8e453f..ba66c682e85decb9608c084caeaaa6b5763c0318 100644 (file)
@@ -295,8 +295,9 @@ void Panel::Loader::unnamed_child<Panel>()
 {
        unique_ptr<Panel> pnl = make_unique<Panel>();
        load_sub(*pnl, wdg_map);
-       obj.add(*pnl.get());
-       last_widget = pnl.release();
+       Widget *wdg = pnl.get();
+       obj.add(move(pnl));
+       last_widget = wdg;
 }