Ssparate the registration from the constructor 71/294671/2
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 22 Jun 2023 23:55:34 +0000 (23:55 +0000)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 23 Jun 2023 00:15:38 +0000 (00:15 +0000)
commit0a4f77d53ff8bf53655cca3a473a8d0f90769789
treef81f20d7b7459148c66e62827477b4546cab10e2
parentd7462409cce1f5eb4b723f8905c3b3bbdfddfbac
Ssparate the registration from the constructor

To prevent segmantation fault issue, this patch separates the app com
registration from the app event constructor.
If the main thread accesses the resource of the derived class when
calling the constructor of the base class in the sub thread,
the segmentation fault issue is occurred as below:

--------------------------------------------------------------------------------
 Thread 33 (LWP 4401):
 #0  0xb5368646 in bundle_free (b=0xabfb0270)
 #1  0xb5369538 in tizen_base::Bundle::~Bundle
 #2  0xb53c9c1e in (anonymous namespace)::AppComCreate
 #3  0xb53c9df8 in aul_app_com_create_async
 #4  0xb53a1630 in aul::AppEvent::AppEvent
 #5  0xb53a17ae in (anonymous namespace)::AppEventStub::AppEventStub

 Thread 1 (LWP 4189):
 #0  0xb5398b74 in aul::AppEvent::OnAppStatusCb
 #1  0xb53c6bd8 in (anonymous namespace)::AppComConnection::Invoke
--------------------------------------------------------------------------------

Change-Id: I045046f64c1f33dcb4ada22ebbc21cffe97b86c7
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
aul/api/aul_app_event.cc
aul/app_manager/app_event.cc
aul/app_manager/app_event.hh