Ensure buffers are deleted if async processing is aborted

This commit is contained in:
baldurk
2026-02-20 13:38:49 +00:00
parent 2db8fef33e
commit ab4f22f107
+16
View File
@@ -3521,7 +3521,10 @@ void BufferViewer::OnEventChanged(uint32_t eventId)
m_Ctx.Replay().AsyncInvoke([this, me, bufdata](IReplayController *r) {
if(!me)
{
delete bufdata;
return;
}
BufferData *buf = NULL;
@@ -3633,7 +3636,10 @@ void BufferViewer::OnEventChanged(uint32_t eventId)
}
if(!me)
{
delete bufdata;
return;
}
}
else
{
@@ -3725,6 +3731,7 @@ void BufferViewer::OnEventChanged(uint32_t eventId)
if(!me)
{
delete buf;
delete bufdata;
return;
}
}
@@ -3742,7 +3749,10 @@ void BufferViewer::OnEventChanged(uint32_t eventId)
GUIInvoke::call(this, [this, bufdata]() {
if(bufdata->sequence != m_Sequence)
{
delete bufdata;
return;
}
if(!bufdata->out1Config.statusString.isEmpty())
{
@@ -4044,12 +4054,18 @@ void BufferViewer::populateBBox(PopulateBufferData *bufdata)
// fire up a thread to calculate the bounding box
LambdaThread *thread = new LambdaThread([this, me, bbox] {
if(!me)
{
delete bbox;
return;
}
calcBoundingData(*bbox);
if(!me)
{
delete bbox;
return;
}
GUIInvoke::call(this, [this, bbox]() { UI_UpdateBoundingBox(*bbox); });
});