Fix ildaeil crash when carla side has UI disabled

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-07-08 12:04:15 +01:00
parent 0a28d20e1a
commit fd3a21add0
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
3 changed files with 16 additions and 8 deletions

2
carla

@ -1 +1 @@
Subproject commit 33bd1f94b33c53e208bb13d09a567a02976b9f1f
Subproject commit 6ee03336ab0a15dba4da78dbf7413624228c5db5

2
dpf

@ -1 +1 @@
Subproject commit aa99d51731cf915d83abb578c232b89fbad6c231
Subproject commit b9e654c3d331933dbeae0413246be8dc2bd64a58

View file

@ -575,11 +575,6 @@ static void host_ui_custom_data_changed(NativeHostHandle handle, const char* key
d_stdout("%s %p %s %s", __FUNCTION__, handle, key, value);
}
static void host_ui_closed(NativeHostHandle handle)
{
d_stdout("%s %p", __FUNCTION__, handle);
}
static const char* host_ui_save_file(NativeHostHandle, bool, const char*, const char*)
{
return nullptr;
@ -806,6 +801,12 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Runner {
setDirty(true);
}
void closeUI() noexcept
{
if (fIdleState == kIdleGiveIdleToUI)
fIdleState = kIdleNothing;
}
void openFileFromDSP(bool /* isDir */, const char* const title, const char* /* filter */)
{
DISTRHO_SAFE_ASSERT_RETURN(idleCallbackActive,);
@ -1083,7 +1084,8 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Runner {
break;
case kIdleGiveIdleToUI:
module->fCarlaPluginDescriptor->ui_idle(module->fCarlaPluginHandle);
if (module->fCarlaPluginDescriptor->ui_idle != nullptr)
module->fCarlaPluginDescriptor->ui_idle(module->fCarlaPluginHandle);
break;
case kIdleChangePluginType:
@ -1634,6 +1636,12 @@ static void host_ui_parameter_changed(const NativeHostHandle handle, const uint3
ui->changeParameterFromDSP(index, value);
}
static void host_ui_closed(const NativeHostHandle handle)
{
if (IldaeilWidget* const ui = static_cast<IldaeilWidget*>(static_cast<IldaeilModule*>(handle)->fUI))
ui->closeUI();
}
static const char* host_ui_open_file(const NativeHostHandle handle,
const bool isDir, const char* const title, const char* const filter)
{