FacesOfMu
Member
I've got this UI object that tests at the end of the DrawGUI event whether the instance is still showing to screen, and if not
In the Destroy Event, it calls the destroy event of some other UI objects it was controlling, and then at the end
The problem I seem to be having is that the first "master" UI instance seems to run another loop of DrawGUI and crashes when it gets to the first reference of one of it's previously destroyed sub-instances.
I even output the ID of the instances at the start and end of the DrawGUI event and destroy event and the ids match as the same object.
So in my output it goes:
What is it about this destroy cycle that I'm not understanding?
Code:
event_perform(ev_destroy,0);
Code:
instance_destroy(id, false);
I even output the ID of the instances at the start and end of the DrawGUI event and destroy event and the ids match as the same object.
So in my output it goes:
Code:
"Start of ui_obj 100130 DrawGui"
//...a bunch of drawgui code
//...passes test to call ev_destroy
event_perform(ev_destroy,0);
"Begin ui_obj 100130 Destroy"
//...destroy other sub-instances
instance_destroy(id, false)
"End ui_obj 100130 Destroy"
"End of ui_obj 100130 DrawGui"
"Start of ui_obj 100130 DrawGui"
(CRASH)
Last edited: