vstgui: fix various ownership problems
This commit is contained in:
parent
acce5d44f5
commit
0205aca375
2 changed files with 9 additions and 7 deletions
|
|
@ -131,6 +131,8 @@ Editor::~Editor()
|
||||||
{
|
{
|
||||||
Impl& impl = *impl_;
|
Impl& impl = *impl_;
|
||||||
|
|
||||||
|
close();
|
||||||
|
|
||||||
EditorController& ctrl = *impl.ctrl_;
|
EditorController& ctrl = *impl.ctrl_;
|
||||||
ctrl.decorate(nullptr);
|
ctrl.decorate(nullptr);
|
||||||
}
|
}
|
||||||
|
|
@ -148,7 +150,7 @@ void Editor::close()
|
||||||
Impl& impl = *impl_;
|
Impl& impl = *impl_;
|
||||||
|
|
||||||
if (impl.frame_) {
|
if (impl.frame_) {
|
||||||
impl.frame_->removeView(impl.view_.get());
|
impl.frame_->removeView(impl.view_.get(), false);
|
||||||
impl.frame_ = nullptr;
|
impl.frame_ = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -284,11 +286,11 @@ void Editor::Impl::createFrameContents()
|
||||||
{
|
{
|
||||||
const CRect bounds { 0.0, 0.0, static_cast<CCoord>(viewWidth), static_cast<CCoord>(viewHeight) };
|
const CRect bounds { 0.0, 0.0, static_cast<CCoord>(viewWidth), static_cast<CCoord>(viewHeight) };
|
||||||
CViewContainer* view = new CViewContainer(bounds);
|
CViewContainer* view = new CViewContainer(bounds);
|
||||||
view_ = view;
|
view_ = owned(view);
|
||||||
|
|
||||||
view->setBackgroundColor(CColor(0xff, 0xff, 0xff));
|
view->setBackgroundColor(CColor(0xff, 0xff, 0xff));
|
||||||
|
|
||||||
SharedPointer<CBitmap> logo { new CBitmap("logo.png") };
|
SharedPointer<CBitmap> logo = owned(new CBitmap("logo.png"));
|
||||||
|
|
||||||
CRect bottomRow = bounds;
|
CRect bottomRow = bounds;
|
||||||
bottomRow.top = bottomRow.bottom - 30;
|
bottomRow.top = bottomRow.bottom - 30;
|
||||||
|
|
@ -688,7 +690,7 @@ void Editor::Impl::createFrameContents()
|
||||||
|
|
||||||
void Editor::Impl::chooseSfzFile()
|
void Editor::Impl::chooseSfzFile()
|
||||||
{
|
{
|
||||||
SharedPointer<CNewFileSelector> fs(CNewFileSelector::create(frame_));
|
SharedPointer<CNewFileSelector> fs = owned(CNewFileSelector::create(frame_));
|
||||||
|
|
||||||
fs->setTitle("Load SFZ file");
|
fs->setTitle("Load SFZ file");
|
||||||
fs->setDefaultExtension(CFileExtension("SFZ", "sfz"));
|
fs->setDefaultExtension(CFileExtension("SFZ", "sfz"));
|
||||||
|
|
@ -705,7 +707,7 @@ void Editor::Impl::chooseSfzFile()
|
||||||
|
|
||||||
void Editor::Impl::chooseScalaFile()
|
void Editor::Impl::chooseScalaFile()
|
||||||
{
|
{
|
||||||
SharedPointer<CNewFileSelector> fs(CNewFileSelector::create(frame_));
|
SharedPointer<CNewFileSelector> fs = owned(CNewFileSelector::create(frame_));
|
||||||
|
|
||||||
fs->setTitle("Load Scala file");
|
fs->setTitle("Load Scala file");
|
||||||
fs->setDefaultExtension(CFileExtension("SCL", "scl"));
|
fs->setDefaultExtension(CFileExtension("SCL", "scl"));
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,8 @@ struct sfizz_ui_t : EditorController, VSTGUIEditorInterface {
|
||||||
LV2_URID_Unmap *unmap = nullptr;
|
LV2_URID_Unmap *unmap = nullptr;
|
||||||
LV2UI_Resize *resize = nullptr;
|
LV2UI_Resize *resize = nullptr;
|
||||||
LV2UI_Touch *touch = nullptr;
|
LV2UI_Touch *touch = nullptr;
|
||||||
std::unique_ptr<Editor> editor;
|
|
||||||
FrameHolder uiFrame;
|
FrameHolder uiFrame;
|
||||||
|
std::unique_ptr<Editor> editor;
|
||||||
#if LINUX
|
#if LINUX
|
||||||
SharedPointer<Lv2IdleRunLoop> runLoop;
|
SharedPointer<Lv2IdleRunLoop> runLoop;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -191,7 +191,7 @@ instantiate(const LV2UI_Descriptor *descriptor,
|
||||||
|
|
||||||
IPlatformFrameConfig* config = nullptr;
|
IPlatformFrameConfig* config = nullptr;
|
||||||
#if LINUX
|
#if LINUX
|
||||||
SharedPointer<Lv2IdleRunLoop> runLoop = new Lv2IdleRunLoop;
|
SharedPointer<Lv2IdleRunLoop> runLoop = owned(new Lv2IdleRunLoop);
|
||||||
self->runLoop = runLoop;
|
self->runLoop = runLoop;
|
||||||
VSTGUI::X11::FrameConfig x11Config;
|
VSTGUI::X11::FrameConfig x11Config;
|
||||||
x11Config.runLoop = runLoop;
|
x11Config.runLoop = runLoop;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue