Fix use-after free when deleting locations
This commit is contained in:
parent
cd4fff863a
commit
fd749173cf
@ -1139,7 +1139,6 @@ Locations::remove (Location *loc)
|
|||||||
_session.set_auto_punch_location (0);
|
_session.set_auto_punch_location (0);
|
||||||
lm.acquire ();
|
lm.acquire ();
|
||||||
}
|
}
|
||||||
delete *i;
|
|
||||||
locations.erase (i);
|
locations.erase (i);
|
||||||
was_removed = true;
|
was_removed = true;
|
||||||
if (current_location == loc) {
|
if (current_location == loc) {
|
||||||
@ -1168,6 +1167,7 @@ Locations::remove (Location *loc)
|
|||||||
if (was_current) {
|
if (was_current) {
|
||||||
current_changed (0); /* EMIT SIGNAL */
|
current_changed (0); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
|
delete loc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user