Re: Again segmentation fault

"Kristian G. Kvilekval" <[email protected]>
Newsgroups gmane.comp.audio.zinf.devel
Message-ID <1059511611.20052.38.camel@merrimack>
I have been integrating them into CVS.
They will be in 2.2.4


Thanks for the patches.  Keep 'em coming!


On Tue, 2003-07-29 at 13:30, Ralf Engels wrote:
> 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
> _______________________________________________
> Zinf-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/zinf-devel
-- 
email:[email protected] office:(805)893-4276 http://www.cs.ucsb.edu/~kris



-------------------------------------------------------
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.