Fix Buttons context, invalid object data access
Another instance of T44376. Crash where the Python context would access a stale pointer to the active object.
This commit is contained in:
		@@ -62,6 +62,7 @@
 | 
			
		||||
#include "ED_buttons.h"
 | 
			
		||||
#include "ED_image.h"
 | 
			
		||||
#include "ED_mesh.h"
 | 
			
		||||
#include "ED_node.h"
 | 
			
		||||
#include "ED_object.h"
 | 
			
		||||
#include "ED_outliner.h"
 | 
			
		||||
#include "ED_paint.h"
 | 
			
		||||
@@ -330,6 +331,7 @@ void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *ar, void *arg_info
 | 
			
		||||
 */
 | 
			
		||||
void ED_spacedata_id_unref(struct SpaceLink *sl, const ID *id)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
	switch (sl->spacetype) {
 | 
			
		||||
		case SPACE_OUTLINER:
 | 
			
		||||
			ED_outliner_id_unref((SpaceOops *)sl, id);
 | 
			
		||||
@@ -337,5 +339,8 @@ void ED_spacedata_id_unref(struct SpaceLink *sl, const ID *id)
 | 
			
		||||
		case SPACE_BUTS:
 | 
			
		||||
			ED_buttons_id_unref((SpaceButs *)sl, id);
 | 
			
		||||
			break;
 | 
			
		||||
		case SPACE_NODE:
 | 
			
		||||
			ED_node_id_unref((SpaceNode *)sl, id);
 | 
			
		||||
			break;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user