summaryrefslogtreecommitdiff
path: root/user/audacious/qt-crash.patch
blob: 4b7d42d3bf3b74d724411ed9fccd16d8de540329 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 61471d51503736d868f5978f5b9a1471f3d2c9ce Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Thu, 20 Sep 2018 12:36:16 -0500
Subject: [PATCH] libaudqt: Fix crash when infopopup is being hidden

Hovering over the track I wanted to listen to showed a tool tip (the
InfoPopup widget); if I moved the mouse in any way after the widget was
displayed, it would immediately crash with a segmentation fault.

Valgrind showed that this was due to s_infopopup being deleted from an
event that involved it.  By switching both `delete` to `deleteLater`,
the crash no longer occurs.

Closes: #828.
---
 src/libaudqt/infopopup-qt.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libaudqt/infopopup-qt.cc b/src/libaudqt/infopopup-qt.cc
index fdbba41d2..cad4d16d5 100644
--- a/src/libaudqt/infopopup-qt.cc
+++ b/src/libaudqt/infopopup-qt.cc
@@ -176,7 +176,7 @@ static InfoPopup * s_infopopup;
 
 static void infopopup_show (const String & filename, const Tuple & tuple)
 {
-    delete s_infopopup;
+    if(s_infopopup) s_infopopup->deleteLater();
     s_infopopup = new InfoPopup (filename, tuple);
 
     QObject::connect (s_infopopup, & QObject::destroyed, [] () {
@@ -206,7 +206,7 @@ EXPORT void infopopup_show_current ()
 
 EXPORT void infopopup_hide ()
 {
-    delete s_infopopup;
+    s_infopopup->deleteLater();
 }
 
 } // namespace audqt
-- 
2.18.0