Skip to content

Conversation

yangyingchao
Copy link
Contributor

fixes #3530

@alebastr
Copy link
Contributor

sigc::mem_fun already disconnects the callbacks bound to any instance of sigc::trackable. So the real problem is that the Bar doesn't inherit from trackable.

diff --git a/include/bar.hpp b/include/bar.hpp
index 27bf877d..d079e04c 100644
--- a/include/bar.hpp
+++ b/include/bar.hpp
@@ -54,7 +54,7 @@ class BarIpcClient;
 }
 #endif  // HAVE_SWAY
 
-class Bar {
+class Bar : public sigc::trackable {
  public:
   using bar_mode_map = std::map<std::string, struct bar_mode>;
   static const bar_mode_map PRESET_MODES;

@yangyingchao
Copy link
Contributor Author

sigc::mem_fun already disconnects the callbacks bound to any instance of sigc::trackable. So the real problem is that the Bar doesn't inherit from trackable.

diff --git a/include/bar.hpp b/include/bar.hpp
index 27bf877d..d079e04c 100644
--- a/include/bar.hpp
+++ b/include/bar.hpp
@@ -54,7 +54,7 @@ class BarIpcClient;
 }
 #endif  // HAVE_SWAY
 
-class Bar {
+class Bar : public sigc::trackable {
  public:
   using bar_mode_map = std::map<std::string, struct bar_mode>;
   static const bar_mode_map PRESET_MODES;

Yep, I did not notice that it uses sigc::mem_fun(), I thought it was using std::mem_fun().

Will update and test later.

@Alexays Alexays merged commit c5a4266 into Alexays:master Aug 19, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crash (sometimes) when opening LID
3 participants