diff --git a/source/Platform/PlatformApplication.cpp b/source/Platform/PlatformApplication.cpp index f50e54b..21148f5 100644 --- a/source/Platform/PlatformApplication.cpp +++ b/source/Platform/PlatformApplication.cpp @@ -13,9 +13,10 @@ typedef sp::UnixApplication ApplicationImpl; namespace sp { -PlatformApplication* PlatformApplication::create() +PlatformApplication* PlatformApplication::get() { - return new ApplicationImpl; + static ApplicationImpl inst; + return &inst; } } // namespace sp diff --git a/source/Platform/PlatformApplication.h b/source/Platform/PlatformApplication.h index d59046d..cfd3331 100644 --- a/source/Platform/PlatformApplication.h +++ b/source/Platform/PlatformApplication.h @@ -13,7 +13,7 @@ class MessageQueue; class PlatformApplication : NonCopyable { public : - static PlatformApplication* create(); + static PlatformApplication* get(); virtual void init() = 0;