[Tizen] Save value to prevent duplicate deletion 69/274069/2
authortscholb <scholb.kim@samsung.com>
Thu, 21 Apr 2022 02:46:53 +0000 (11:46 +0900)
committertscholb <scholb.kim@samsung.com>
Thu, 21 Apr 2022 03:03:49 +0000 (12:03 +0900)
If TriggerEvent is deleted in TriggerEvent::Triggered(),an incorrect value may be written to mOptions.
In this case, duplicate deletion occurs and a collision occurs.
To prevent this, the mOptions value was modified to be stored locally.

Change-Id: I37d149297e707a75eecd6cbd75a1a20307d62ace

dali/internal/system/common/trigger-event.cpp

index 1f94e51..8f769af 100644 (file)
@@ -104,11 +104,14 @@ void TriggerEvent::Triggered(FileDescriptorMonitor::EventType eventBitMask, int
     DALI_LOG_WARNING("Unable to read to UpdateEvent File descriptor\n");
   }
 
+  // Save value to prevent duplicate deletion
+  TriggerEventInterface::Options options = mOptions;
+
   // Call the connected callback
   CallbackBase::Execute(*mCallback);
 
   //check if we should delete ourselves after the trigger
-  if(mOptions == TriggerEventInterface::DELETE_AFTER_TRIGGER)
+  if(options == TriggerEventInterface::DELETE_AFTER_TRIGGER)
   {
     delete this;
   }