mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 09:53:25 +00:00
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:
parent
3f9ae43250
commit
cdc2f0ded6
3 changed files with 36 additions and 18 deletions
10
ChangeLog
10
ChangeLog
|
@ -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>
|
2004-02-26 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/widgets/Makefile.am
|
* app/widgets/Makefile.am
|
||||||
|
|
|
@ -324,10 +324,24 @@ app_exit_after_callback (Gimp *gimp,
|
||||||
if (gimp->be_verbose)
|
if (gimp->be_verbose)
|
||||||
g_print ("EXIT: app_exit_after_callback\n");
|
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)
|
if (loop)
|
||||||
g_main_loop_quit (loop);
|
g_main_loop_quit (loop);
|
||||||
else
|
else
|
||||||
gtk_main_quit ();
|
gtk_main_quit ();
|
||||||
|
|
||||||
|
#else
|
||||||
|
exit (EXIT_SUCCESS);
|
||||||
|
#endif
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,9 +200,7 @@ gimp_progress_restart (GimpProgress *progress,
|
||||||
/* change the message */
|
/* change the message */
|
||||||
if (progress->gdisp)
|
if (progress->gdisp)
|
||||||
{
|
{
|
||||||
GimpDisplayShell *shell;
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
|
||||||
|
|
||||||
shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
|
|
||||||
|
|
||||||
gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar), "progress");
|
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? */
|
/* do we have a dialog box, or are we using the statusbar? */
|
||||||
if (progress->gdisp)
|
if (progress->gdisp)
|
||||||
{
|
{
|
||||||
GimpDisplayShell *shell;
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
|
||||||
|
|
||||||
shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
|
|
||||||
|
|
||||||
bar = GIMP_STATUSBAR (shell->statusbar)->progressbar;
|
bar = GIMP_STATUSBAR (shell->statusbar)->progressbar;
|
||||||
}
|
}
|
||||||
|
@ -280,9 +276,7 @@ gimp_progress_step (GimpProgress *progress)
|
||||||
|
|
||||||
if (progress->gdisp)
|
if (progress->gdisp)
|
||||||
{
|
{
|
||||||
GimpDisplayShell *shell;
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
|
||||||
|
|
||||||
shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
|
|
||||||
|
|
||||||
bar = GIMP_STATUSBAR (shell->statusbar)->progressbar;
|
bar = GIMP_STATUSBAR (shell->statusbar)->progressbar;
|
||||||
}
|
}
|
||||||
|
@ -310,6 +304,12 @@ gimp_progress_end (GimpProgress *progress)
|
||||||
{
|
{
|
||||||
g_return_if_fail (progress != NULL);
|
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
|
/* remove all callbacks so they don't get called while we're
|
||||||
* destroying widgets
|
* destroying widgets
|
||||||
*/
|
*/
|
||||||
|
@ -317,11 +317,9 @@ gimp_progress_end (GimpProgress *progress)
|
||||||
|
|
||||||
if (progress->gdisp)
|
if (progress->gdisp)
|
||||||
{
|
{
|
||||||
GimpDisplayShell *shell;
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
|
||||||
GtkProgressBar *bar;
|
GtkProgressBar *bar;
|
||||||
|
|
||||||
shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
|
|
||||||
|
|
||||||
gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar), "progress");
|
gimp_statusbar_pop (GIMP_STATUSBAR (shell->statusbar), "progress");
|
||||||
|
|
||||||
bar = GTK_PROGRESS_BAR (GIMP_STATUSBAR (shell->statusbar)->progressbar);
|
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? */
|
/* are we using the statusbar or a freestanding dialog? */
|
||||||
if (progress->gdisp)
|
if (progress->gdisp)
|
||||||
{
|
{
|
||||||
GimpDisplayShell *shell;
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
|
||||||
|
|
||||||
shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
|
|
||||||
|
|
||||||
dialog = NULL;
|
dialog = NULL;
|
||||||
button = GIMP_STATUSBAR (shell->statusbar)->cancelbutton;
|
button = GIMP_STATUSBAR (shell->statusbar)->cancelbutton;
|
||||||
|
@ -447,9 +443,7 @@ gimp_progress_response (GtkWidget *dialog,
|
||||||
|
|
||||||
if (progress->gdisp)
|
if (progress->gdisp)
|
||||||
{
|
{
|
||||||
GimpDisplayShell *shell;
|
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
|
||||||
|
|
||||||
shell = GIMP_DISPLAY_SHELL (progress->gdisp->shell);
|
|
||||||
|
|
||||||
button = GIMP_STATUSBAR (shell->statusbar)->cancelbutton;
|
button = GIMP_STATUSBAR (shell->statusbar)->cancelbutton;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue