Browse Source

Avoid assertion if LV2 UI widget is null

tags/v1.9.9
falkTX 6 years ago
parent
commit
8aa84234c7
2 changed files with 9 additions and 5 deletions
  1. +7
    -4
      source/backend/plugin/CarlaPluginLV2.cpp
  2. +2
    -1
      source/bridges-ui/CarlaBridgeFormatLV2.cpp

+ 7
- 4
source/backend/plugin/CarlaPluginLV2.cpp View File

@@ -1443,12 +1443,16 @@ public:
fFeatures[kFeatureIdUiParent]->data = fUI.window->getPtr();
}
#endif
if (fUI.window != nullptr)
fUI.window->setTitle(fLv2Options.windowTitle);

fUI.widget = nullptr;
fUI.handle = fUI.descriptor->instantiate(fUI.descriptor, fRdfDescriptor->URI, fUI.rdfDescriptor->Bundle,
carla_lv2_ui_write_function, this, &fUI.widget, fFeatures);

if (fUI.window != nullptr)
{
fUI.window->setChildWindow(fUI.widget);
fUI.window->setTitle(fLv2Options.windowTitle);
}

}

CARLA_SAFE_ASSERT(fUI.handle != nullptr);
@@ -1474,7 +1478,6 @@ public:
{
if (fUI.window != nullptr)
{
fUI.window->setChildWindow(fUI.widget);
fUI.window->show();
}
else if (fExt.uishow != nullptr)


+ 2
- 1
source/bridges-ui/CarlaBridgeFormatLV2.cpp View File

@@ -441,7 +441,8 @@ public:
CARLA_SAFE_ASSERT_RETURN(fHandle != nullptr, false);

#if defined(BRIDGE_COCOA) || defined(BRIDGE_HWND) || defined(BRIDGE_X11)
fToolkit->setChildWindow(fWidget);
if (fWidget != nullptr)
fToolkit->setChildWindow(fWidget);
#endif

// ------------------------------------------------------------------------------------------------------------


Loading…
Cancel
Save