Again segmentation fault

Ralf Engels <[email protected]>
Newsgroups gmane.comp.audio.zinf.devel
Message-ID <[email protected]>
Hi,
again a segmentation fault.
This time when starting zinf with --help.

The GTKWindow get's destroyed but the variable is not nulled.

Can you please give me feedback if someone integrates the patches or if 
they are just moved to /dev/null?


Anyway, here is the fix...


--- GTKWindow.cpp.old   2003-07-27 00:52:32.000000000 +0200
+++ GTKWindow.cpp       2003-07-27 19:53:52.000000000 +0200
@@ -208,7 +208,6 @@
            :Window(pTheme, oName)
  {
      m_theme = pTheme;
-    m_pCanvas = new GTKCanvas(this);
      m_pMindMeldMutex = new Mutex();

      lastDockPos.x = -1;
@@ -228,6 +227,9 @@
      gdk_window_set_decorations(mainWindow->window, (GdkWMDecoration)0);
      gdk_threads_leave();

+    // before canvas, init the window...
+    m_pCanvas = new GTKCanvas(this);
+
      initialized = false;
      m_bMouseInWindow = false;
      quitLoop = false;
@@ -422,6 +424,7 @@
      gdk_threads_enter();
      gtk_timeout_remove(gtkTimer);
      gtk_widget_destroy(mainWindow);
+    mainWindow = NULL;
      gdk_flush();
      gdk_threads_leave();

@@ -457,6 +460,8 @@

  Error GTKWindow::SetTitle(string &oTitle)
  {
+    if( !mainWindow ) // it seems that someone tries to set the title 
on a closed window (Ralf)
+      return kError_NoErr;
      gdk_threads_enter();
      gtk_window_set_title(GTK_WINDOW(mainWindow), oTitle.c_str());
      gdk_threads_leave();



--- GTKCanvas.cpp.old   2003-07-27 19:13:18.000000000 +0200
+++ GTKCanvas.cpp       2003-07-27 19:13:20.000000000 +0200
@@ -149,7 +149,7 @@
  {
      assert(m_pParent);
      GtkWidget *w = m_pParent->GetWindow();
-    if (!w->window || !m_pBufferBitmap)
+    if ( !w || !w->window || !m_pBufferBitmap)
          return;
      gdk_threads_enter();
      gdk_window_set_back_pixmap(w->window, 
m_pBufferBitmap->GetBitmap(), 0);





-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.