gimp r27145 - in trunk: . app/core



Author: mitch
Date: Mon Oct  6 19:54:42 2008
New Revision: 27145
URL: http://svn.gnome.org/viewvc/gimp?rev=27145&view=rev

Log:
2008-10-06  Michael Natterer  <mitch gimp org>

	* app/core/gimpcontext.c (gimp_context_real_set_display): paranoia
	fix for hypothetical but harmful misbehavior: when setting the
	display from !=NULL to NULL, also set the image to NULL instead of
	relying on whatever obscure implicit behavior of other parts of
	GIMP which set a new display right away or make sure the image
	goes away together with the display.



Modified:
   trunk/ChangeLog
   trunk/app/core/gimpcontext.c

Modified: trunk/app/core/gimpcontext.c
==============================================================================
--- trunk/app/core/gimpcontext.c	(original)
+++ trunk/app/core/gimpcontext.c	Mon Oct  6 19:54:42 2008
@@ -1766,9 +1766,13 @@
 gimp_context_real_set_display (GimpContext *context,
                                gpointer     display)
 {
+  GimpObject *old_display;
+
   if (context->display == display)
     return;
 
+  old_display = context->display;
+
   context->display = display;
 
   if (context->display)
@@ -1782,6 +1786,10 @@
       if (image)
         g_object_unref (image);
     }
+  else if (old_display)
+    {
+      gimp_context_real_set_image (context, NULL);
+    }
 
   g_object_notify (G_OBJECT (context), "display");
   gimp_context_display_changed (context);



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