diff --git a/runtime/legion/legion_instances.cc b/runtime/legion/legion_instances.cc index facdf739fe..ccc70e6bf8 100644 --- a/runtime/legion/legion_instances.cc +++ b/runtime/legion/legion_instances.cc @@ -3942,9 +3942,11 @@ namespace Legion { if (runtime->profiler != NULL) runtime->profiler->handle_failed_instance_allocation(); } + fevent = current_unique_event; // No matter what trigger the event + // Can't read anything after trigger the event as the object + // might be deleted after we do that Runtime::trigger_event(profiling_ready); - fevent = current_unique_event; return true; } diff --git a/runtime/legion/runtime.cc b/runtime/legion/runtime.cc index 90a8ac1a54..19d1d7bc1c 100644 --- a/runtime/legion/runtime.cc +++ b/runtime/legion/runtime.cc @@ -11029,8 +11029,10 @@ namespace Legion { assert(measured); #endif success.store(result.success); - Runtime::trigger_event(ready); fevent = unique_event; + // Can't read anything after trigger the event as the object + // might be deleted after we do that + Runtime::trigger_event(ready); return true; }