Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix careless unlink call in instance_change() (#1046)
Use `instance_destroy(id, call_destroy)` instead, as this handles cleaning up dangling iterators. This function is still a major hack; not sure who wrote it. At least now it won't segfault.
  • Loading branch information
JoshDreamland committed Apr 23, 2017
1 parent f7c5b11 commit 0b594f2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ENIGMAsystem/SHELL/Universal_System/instance_create.h
Expand Up @@ -36,13 +36,12 @@ namespace enigma
// visible,

//the instance id is the same
int idn=inst->id;
int idn = inst->id;

//Destory the instance
if (perf) inst->myevent_destroy();
inst->unlink();
// Destroy the instance
instance_destroy(idn, perf);

//Create the instance
// Re-create the instance
object_basic* ob = NULL;
switch((int)obj)
{
Expand Down

0 comments on commit 0b594f2

Please sign in to comment.