summaryrefslogtreecommitdiff
path: root/gui-libs/pixdecor/files/pixdecor-shade-callback-lifetime.patch
blob: 35b3291f3dcd25249eb05c8db3d01133ac609e82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
--- a/src/shade.hpp
+++ b/src/shade.hpp
@@ -208,6 +208,9 @@
 
     wf::effect_hook_t pre_hook = [=] ()
     {
+        // Unshade completion can remove the scene tree's last reference to us.
+        // Keep the transformer and this member callback alive until it returns.
+        auto keep_alive = shared_from_this();
         /* Follow the view if it has moved to another output since last frame. */
         if (view && view->get_output() && (view->get_output() != hook_output))
         {