From ec05e1ff57e3a1c391db66bc50e221d1c2f1f29d Mon Sep 17 00:00:00 2001 From: Kurt Kartaltepe Date: Mon, 21 Feb 2022 07:03:11 -0800 Subject: [PATCH] UI: Avoid calling obs_source_update multiple times When we added undo/redo in 86eb7aeb a distinction between Updates and Visual updates was made, presumably for filters which need special handling of the update case. These functions were also added to regular source properties, but didnt use any special code instead calling obs_source_update an additional time after a short time. Instead lets remove the 2nd delayed call and only call obs_source_update once per settings change. --- UI/window-basic-properties.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/UI/window-basic-properties.cpp b/UI/window-basic-properties.cpp index 885ae9576..30455d2aa 100644 --- a/UI/window-basic-properties.cpp +++ b/UI/window-basic-properties.cpp @@ -86,20 +86,10 @@ OBSBasicProperties::OBSBasicProperties(QWidget *parent, OBSSource source_) OBSDataAutoRelease nd_settings = obs_source_get_settings(source); obs_data_apply(oldSettings, nd_settings); - auto handle_memory = [](void *vp, obs_data_t *old_settings, - obs_data_t *new_settings) { - obs_source_t *source = reinterpret_cast(vp); - - obs_source_update(source, new_settings); - - UNUSED_PARAMETER(old_settings); - UNUSED_PARAMETER(vp); - }; - view = new OBSPropertiesView( nd_settings.Get(), source, (PropertiesReloadCallback)obs_source_properties, - (PropertiesUpdateCallback)handle_memory, + (PropertiesUpdateCallback) nullptr, // No special handling required for undo/redo (PropertiesVisualUpdateCb)obs_source_update); view->setMinimumHeight(150);