From: Richard Huang Date: Fri, 9 Aug 2019 15:04:55 +0000 (+0100) Subject: Keep the handle of SceneHolder before processing events in Core X-Git-Tag: dali_1.4.33~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=083595aa0dfcf6c81afb7ba999d19ade465f9d8d Keep the handle of SceneHolder before processing events in Core Change-Id: I042e3c27e5de8fc82f75170e34ebfbea0a79b933 --- diff --git a/dali/integration-api/scene-holder-impl.cpp b/dali/integration-api/scene-holder-impl.cpp index d8d456f..3a7bc5a 100644 --- a/dali/integration-api/scene-holder-impl.cpp +++ b/dali/integration-api/scene-holder-impl.cpp @@ -287,6 +287,10 @@ void SceneHolder::FeedTouchPoint( Dali::Integration::Point& point, int timeStamp { DALI_LOG_INFO( gTouchEventLogFilter, Debug::General, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetScreenPosition().x, point.GetScreenPosition().y ); + // Signals can be emitted while processing core events, and the scene holder could be deleted in the signal callback. + // Keep the handle alive until the core events are processed. + Dali::BaseHandle sceneHolder( this ); + // First the touch and/or hover event & related gesture events are queued if( type == Integration::TouchEventCombiner::DispatchTouch || type == Integration::TouchEventCombiner::DispatchBoth ) { @@ -305,6 +309,10 @@ void SceneHolder::FeedTouchPoint( Dali::Integration::Point& point, int timeStamp void SceneHolder::FeedWheelEvent( Dali::Integration::WheelEvent& wheelEvent ) { + // Signals can be emitted while processing core events, and the scene holder could be deleted in the signal callback. + // Keep the handle alive until the core events are processed. + Dali::BaseHandle sceneHolder( this ); + mScene.QueueEvent( wheelEvent ); mAdaptor->ProcessCoreEvents(); } @@ -320,6 +328,10 @@ void SceneHolder::FeedKeyEvent( Dali::Integration::KeyEvent& keyEvent ) } } + // Signals can be emitted while processing core events, and the scene holder could be deleted in the signal callback. + // Keep the handle alive until the core events are processed. + Dali::BaseHandle sceneHolder( this ); + // Create send KeyEvent to Core. mScene.QueueEvent( keyEvent ); mAdaptor->ProcessCoreEvents();