[gparted] Prevent GSource double-destroy warning messages (#729800)



commit 2e7b5d05a6324c1370248af93925cbc95b9db0ac
Author: Phillip Susi <psusi ubuntu com>
Date:   Sat May 10 16:17:20 2014 -0400

    Prevent GSource double-destroy warning messages (#729800)
    
    Returning false from the OnReadable callback causes the source to
    be destroyed, but PipeCapture::~PipeCapture was destroying it a
    second time.  Prevent this by zeroing out the sourceid.
    
    Bug 729800 - Prevent GSource double-destroy warning messages

 src/PipeCapture.cc |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/PipeCapture.cc b/src/PipeCapture.cc
index 0a8f388..bbb400e 100644
--- a/src/PipeCapture.cc
+++ b/src/PipeCapture.cc
@@ -41,7 +41,11 @@ gboolean PipeCapture::_OnReadable( GIOChannel *source,
                                   GIOCondition condition,
                                   gpointer data )
 {
-       return static_cast<PipeCapture *>(data)->OnReadable( Glib::IOCondition(condition) );
+       PipeCapture *pc = static_cast<PipeCapture *>(data);
+       gboolean rc = pc->OnReadable( Glib::IOCondition(condition) );
+       if (!rc)
+               pc->sourceid = 0;
+       return rc;
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]