mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-14 22:05:59 +00:00
Haiku modernizing a bit the C++ code with C++11 heuristics
with BApplication
This commit is contained in:

committed by
Sam Lantinga

parent
2897de9efc
commit
d73f2d76a0
@@ -30,6 +30,7 @@
|
||||
#include <storage/Entry.h>
|
||||
#include <storage/File.h>
|
||||
#include <unistd.h>
|
||||
#include <memory>
|
||||
|
||||
#include "SDL_BApp.h" /* SDL_BApp class definition */
|
||||
#include "SDL_BeApp.h"
|
||||
@@ -51,8 +52,9 @@ const char *signature = "application/x-SDL-executable";
|
||||
|
||||
static int StartBeApp(void *unused)
|
||||
{
|
||||
BApplication *App;
|
||||
std::unique_ptr<BApplication> App;
|
||||
|
||||
(void)unused;
|
||||
// dig resources for correct signature
|
||||
image_info info;
|
||||
int32 cookie = 0;
|
||||
@@ -69,10 +71,9 @@ static int StartBeApp(void *unused)
|
||||
}
|
||||
}
|
||||
|
||||
App = new SDL_BApp(signature);
|
||||
App = std::unique_ptr<BApplication>(new SDL_BApp(signature));
|
||||
|
||||
App->Run();
|
||||
delete App;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user