From 2d77bdcd946f1673a8a1e7be596982842d3d6844 Mon Sep 17 00:00:00 2001 From: jatinchowdhury18 Date: Sun, 16 Jun 2024 23:39:36 -0700 Subject: [PATCH] Fixing deadlock in AnalogEQPlot destructor (#43) * Fixing deadlock in AnalogEQPlot destructor * Apply clang-format * Fixing include dir --------- Co-authored-by: github-actions[bot] --- modules/CMakeLists.txt | 3 +-- modules/LBFGSpp/CMakeLists.txt | 2 +- src/gui/AnalogEQ/AnalogEQPlot.cpp | 8 ++++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 25449fe..a7045c6 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -1,7 +1,6 @@ add_subdirectory(JUCE) add_subdirectory(chowdsp_utils) add_subdirectory(chowdsp_wdf) -add_subdirectory(eigen) add_subdirectory(LBFGSpp) subproject_version(JUCE juce_version) @@ -28,7 +27,6 @@ target_link_libraries(juce_plugin_modules chowdsp::chowdsp_wdf chowdsp::chowdsp_gui chowdsp::chowdsp_visualizers - Eigen3::Eigen lbfgspp PUBLIC juce::juce_recommended_config_flags @@ -73,6 +71,7 @@ target_compile_definitions(juce_plugin_modules target_include_directories(juce_plugin_modules PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/exprtk + ${CMAKE_CURRENT_SOURCE_DIR}/eigen INTERFACE $ ) diff --git a/modules/LBFGSpp/CMakeLists.txt b/modules/LBFGSpp/CMakeLists.txt index be08316..ddb94c5 100644 --- a/modules/LBFGSpp/CMakeLists.txt +++ b/modules/LBFGSpp/CMakeLists.txt @@ -38,7 +38,7 @@ target_include_directories(lbfgspp INTERFACE # | FIND EXTERNAL LIBRARIES | # + ----------------------- + -target_link_libraries(lbfgspp INTERFACE Eigen3::Eigen) +#target_link_libraries(lbfgspp INTERFACE Eigen3::Eigen) # + ------------ + # | INSTALLATION | diff --git a/src/gui/AnalogEQ/AnalogEQPlot.cpp b/src/gui/AnalogEQ/AnalogEQPlot.cpp index aaa55f9..a70672a 100644 --- a/src/gui/AnalogEQ/AnalogEQPlot.cpp +++ b/src/gui/AnalogEQ/AnalogEQPlot.cpp @@ -79,8 +79,12 @@ int AnalogEQPlot::BackgroundPlotter::useTimeSlice() { filterPlotter.updateFilterPlot(); - juce::MessageManagerLock mml {}; - parent.repaint(); + juce::MessageManager::callAsync ( + [safeParent = juce::Component::SafePointer { &parent }] + { + if (safeParent != nullptr) + safeParent->repaint(); + }); } return 30;