source/Platform/PlatformApplication: rename create() to get() and just return a statically allocated implementation.
As we just this throughout the whole program. and platform can be determined at compile time. we might as well allocate it statically.
This commit is contained in:
parent
859e95eea8
commit
c7d380c4b0
2 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class MessageQueue;
|
|||
class PlatformApplication : NonCopyable
|
||||
{
|
||||
public :
|
||||
static PlatformApplication* create();
|
||||
static PlatformApplication* get();
|
||||
|
||||
virtual void init() = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue