check display->shell before using it. It might be NULL if the function is

2004-02-26  Sven Neumann  <sven@gimp.org>

	* app/display/gimpprogress.c (gimp_progress_end): check
	display->shell before using it. It might be NULL if the function
	is being called from gimp_exit().

	* app/app_procs.c (app_exit_after_callback): added back the call
	to exit() but only for stable releases. See my comments in the
	code to understand the reasons.
This commit is contained in:
Sven Neumann 2004-02-26 14:01:57 +00:00 committed by Sven Neumann
parent 3f9ae43250
commit cdc2f0ded6
3 changed files with 36 additions and 18 deletions

View File

@ -1,3 +1,13 @@
2004-02-26 Sven Neumann <sven@gimp.org>
* app/display/gimpprogress.c (gimp_progress_end): check
display->shell before using it. It might be NULL if the function
is being called from gimp_exit().
* app/app_procs.c (app_exit_after_callback): added back the call
to exit() but only for stable releases. See my comments in the
code to understand the reasons.
2004-02-26 Michael Natterer <mitch@gimp.org>
* app/widgets/Makefile.am

View File

@ -324,10 +324,24 @@ app_exit_after_callback (Gimp *gimp,
if (gimp->be_verbose)
g_print ("EXIT: app_exit_after_callback\n");
/*
* In stable releases, we simply call exit() here. This speeds up
* the process of quitting GIMP and also works around the problem
* that plug-ins might still be running.
*
* In unstable releases, we shut down GIMP properly in an attempt
* to catch possible problems in our finalizers.
*/
#ifdef GIMP_UNSTABLE
if (loop)
g_main_loop_quit (loop);
else
gtk_main_quit ();
#else
exit (EXIT_SUCCESS);
#endif
return FALSE;
}

View File

@ -200,9 +200,7 @@ gimp_progress_restart (GimpProgress *progress,
/* change the message */
if (progress->gdisp)
{
GimpDisplayShell *shell;
shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar), "progress");
@ -245,9 +243,7 @@ gimp_progress_update (GimpProgress *progress,
/* do we have a dialog box, or are we using the statusbar? */
if (progress->gdisp)
{
GimpDisplayShell *shell;
shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
bar = GIMP_STATUSBAR (shell->statusbar)->progressbar;
}
@ -280,9 +276,7 @@ gimp_progress_step (GimpProgress *progress)
if (progress->gdisp)
{
GimpDisplayShell *shell;
shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
bar = GIMP_STATUSBAR (shell->statusbar)->progressbar;
}
@ -310,6 +304,12 @@ gimp_progress_end (GimpProgress *progress)
{
g_return_if_fail (progress != NULL);
/* We might get called from gimp_exit() and at that time
* the display shell has been destroyed already.
*/
if (progress->gdisp && !progress->gdisp->shell)
return;
/* remove all callbacks so they don't get called while we're
* destroying widgets
*/
@ -317,11 +317,9 @@ gimp_progress_end (GimpProgress *progress)
if (progress->gdisp)
{
GimpDisplayShell *shell;
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
GtkProgressBar *bar;
shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar), "progress");
bar = GTK_PROGRESS_BAR (GIMP_STATUSBAR (shell->statusbar)->progressbar);
@ -386,9 +384,7 @@ gimp_progress_signal_setup (GimpProgress *progress,
/* are we using the statusbar or a freestanding dialog? */
if (progress->gdisp)
{
GimpDisplayShell *shell;
shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
dialog = NULL;
button = GIMP_STATUSBAR (shell->statusbar)->cancelbutton;
@ -447,9 +443,7 @@ gimp_progress_response (GtkWidget *dialog,
if (progress->gdisp)
{
GimpDisplayShell *shell;
shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
button = GIMP_STATUSBAR (shell->statusbar)->cancelbutton;
}