mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-14 02:07:49 +00:00
Added macros to push/pop error messages while cleaning up
(cherry picked from commit 885e611f3c)
This commit is contained in:
parent
1081b70951
commit
abbaf95cf0
2 changed files with 8 additions and 0 deletions
|
|
@ -265,6 +265,12 @@ extern "C" {
|
|||
#include "SDL_utils_c.h"
|
||||
#include "SDL_hashtable.h"
|
||||
|
||||
#define PUSH_SDL_ERROR() \
|
||||
{ char *_error = SDL_strdup(SDL_GetError());
|
||||
|
||||
#define POP_SDL_ERROR() \
|
||||
SDL_SetError("%s", _error); SDL_free(_error); }
|
||||
|
||||
// Do any initialization that needs to happen before threads are started
|
||||
extern void SDL_InitMainThread(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -2513,7 +2513,9 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
|
|||
SDL_UpdateWindowHierarchy(window, parent);
|
||||
|
||||
if (_this->CreateSDLWindow && !_this->CreateSDLWindow(_this, window, props)) {
|
||||
PUSH_SDL_ERROR()
|
||||
SDL_DestroyWindow(window);
|
||||
POP_SDL_ERROR()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue