Add Window System's Initailize() and ShutDown() for UI Threading.
Because Window's Initialize() and ShutDown() should be called in UI Thread when UI Threading is enabled.
Change-Id: I8d1a4e8e85366d31efa1c0690d436b409f4c791d
- WindowSystem::Initialize();
-
mCommandLineOptions = new CommandLineOptions(argc, argv);
mFramework = new Framework(*this, *this, argc, argv, applicationType, mUseUiThread);
mUseRemoteSurface = (applicationType == Framework::WATCH);
mCommandLineOptions = new CommandLineOptions(argc, argv);
mFramework = new Framework(*this, *this, argc, argv, applicationType, mUseUiThread);
mUseRemoteSurface = (applicationType == Framework::WATCH);
- delete mAdaptor;
- delete mAdaptorBuilder;
delete mCommandLineOptions;
delete mFramework;
delete mCommandLineOptions;
delete mFramework;
- WindowSystem::Shutdown();
+ // Application is created in Main thread whether UI Threading is enabled or not.
+ // But some resources are created in Main thread or UI thread.
+ // The below code is for the resource are created in Main thread.
+ if(!mUseUiThread)
+ {
+ delete mAdaptor;
+ delete mAdaptorBuilder;
+ WindowSystem::Shutdown();
+ }
}
void Application::StoreWindowPositionSize(PositionSize positionSize)
}
void Application::StoreWindowPositionSize(PositionSize positionSize)
{
Internal::Adaptor::Window* window;
{
Internal::Adaptor::Window* window;
+ WindowSystem::Initialize();
+
if(mLaunchpadState != Launchpad::PRE_INITIALIZED)
{
if(mWindowPositionSize.width == 0 && mWindowPositionSize.height == 0)
if(mLaunchpadState != Launchpad::PRE_INITIALIZED)
{
if(mWindowPositionSize.width == 0 && mWindowPositionSize.height == 0)
}
mMainWindow.Reset(); // This only resets (clears) the default Window
}
mMainWindow.Reset(); // This only resets (clears) the default Window
+
+ // If DALi's UI Thread works, some resources are created in UI Thread, not Main thread.
+ // For that case, these resource should be deleted in UI Thread.
+ if(mUseUiThread)
+ {
+ delete mAdaptor;
+ delete mAdaptorBuilder;
+ WindowSystem::Shutdown();
+ }
}
void Application::OnPause()
}
void Application::OnPause()