[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36265] trunk/blender/source/blender/ windowmanager/intern/wm_event_system.c: Fix for fix for the bugfix :)

Ton Roosendaal ton at blender.org
Thu Apr 21 11:43:39 CEST 2011


Revision: 36265
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36265
Author:   ton
Date:     2011-04-21 09:43:38 +0000 (Thu, 21 Apr 2011)
Log Message:
-----------
Fix for fix for the bugfix :)

Just cleaned the code/order here and added comments why this works.
I should have known it... thanks Andrea for quick action!

Modified Paths:
--------------
    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c

Modified: trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_event_system.c	2011-04-21 09:38:09 UTC (rev 36264)
+++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c	2011-04-21 09:43:38 UTC (rev 36265)
@@ -1537,20 +1537,16 @@
 			}
 		}
 		
-		/* modal ui handler can be tagged to be freed */ 
-		/* XXX TODO - handler was free'd in wm_handler_ui_call 
-		       and memory could be written to in BLI_remlink.
-			   As temporary solution preventing this by
-			   making sure handler is still in the list.
-		*/   
+		/* XXX code this for all modal ops, and ensure free only happens here */
 		
-		if(handler->flag & WM_HANDLER_DO_FREE) {
-			if (BLI_findindex(handlers, handler) >= 0) {
+		/* modal ui handler can be tagged to be freed */ 
+		if(BLI_findindex(handlers, handler) != -1) { /* could be free'd already by regular modal ops */
+			if(handler->flag & WM_HANDLER_DO_FREE) {
 				BLI_remlink(handlers, handler);
 				wm_event_free_handler(handler);
 			}
 		}
-
+		
 		/* XXX fileread case */
 		if(CTX_wm_window(C)==NULL)
 			return action;




More information about the Bf-blender-cvs mailing list