diff --git a/editor/src/editor/Editor.cpp b/editor/src/editor/Editor.cpp index dccae14c..d50aa5b4 100644 --- a/editor/src/editor/Editor.cpp +++ b/editor/src/editor/Editor.cpp @@ -131,6 +131,8 @@ Editor::~Editor() { Impl& impl = *impl_; + close(); + EditorController& ctrl = *impl.ctrl_; ctrl.decorate(nullptr); } @@ -148,7 +150,7 @@ void Editor::close() Impl& impl = *impl_; if (impl.frame_) { - impl.frame_->removeView(impl.view_.get()); + impl.frame_->removeView(impl.view_.get(), false); impl.frame_ = nullptr; } } @@ -284,11 +286,11 @@ void Editor::Impl::createFrameContents() { const CRect bounds { 0.0, 0.0, static_cast(viewWidth), static_cast(viewHeight) }; CViewContainer* view = new CViewContainer(bounds); - view_ = view; + view_ = owned(view); view->setBackgroundColor(CColor(0xff, 0xff, 0xff)); - SharedPointer logo { new CBitmap("logo.png") }; + SharedPointer logo = owned(new CBitmap("logo.png")); CRect bottomRow = bounds; bottomRow.top = bottomRow.bottom - 30; @@ -688,7 +690,7 @@ void Editor::Impl::createFrameContents() void Editor::Impl::chooseSfzFile() { - SharedPointer fs(CNewFileSelector::create(frame_)); + SharedPointer fs = owned(CNewFileSelector::create(frame_)); fs->setTitle("Load SFZ file"); fs->setDefaultExtension(CFileExtension("SFZ", "sfz")); @@ -705,7 +707,7 @@ void Editor::Impl::chooseSfzFile() void Editor::Impl::chooseScalaFile() { - SharedPointer fs(CNewFileSelector::create(frame_)); + SharedPointer fs = owned(CNewFileSelector::create(frame_)); fs->setTitle("Load Scala file"); fs->setDefaultExtension(CFileExtension("SCL", "scl")); diff --git a/lv2/sfizz_ui.cpp b/lv2/sfizz_ui.cpp index 10ed2cbe..70ff76e1 100644 --- a/lv2/sfizz_ui.cpp +++ b/lv2/sfizz_ui.cpp @@ -86,8 +86,8 @@ struct sfizz_ui_t : EditorController, VSTGUIEditorInterface { LV2_URID_Unmap *unmap = nullptr; LV2UI_Resize *resize = nullptr; LV2UI_Touch *touch = nullptr; - std::unique_ptr editor; FrameHolder uiFrame; + std::unique_ptr editor; #if LINUX SharedPointer runLoop; #endif @@ -191,7 +191,7 @@ instantiate(const LV2UI_Descriptor *descriptor, IPlatformFrameConfig* config = nullptr; #if LINUX - SharedPointer runLoop = new Lv2IdleRunLoop; + SharedPointer runLoop = owned(new Lv2IdleRunLoop); self->runLoop = runLoop; VSTGUI::X11::FrameConfig x11Config; x11Config.runLoop = runLoop;