mirror of https://github.com/encounter/SDL.git
WinRT: Removed dead code and fixed memory leak if allocation for driver failed.
This commit is contained in:
parent
b82f48bad3
commit
0c923fda0b
|
@ -118,15 +118,13 @@ WINRT_CreateDevice(int devindex)
|
||||||
device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
|
device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
|
||||||
if (!device) {
|
if (!device) {
|
||||||
SDL_OutOfMemory();
|
SDL_OutOfMemory();
|
||||||
if (device) {
|
|
||||||
SDL_free(device);
|
|
||||||
}
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
data = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
|
data = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
|
||||||
if (!data) {
|
if (!data) {
|
||||||
SDL_OutOfMemory();
|
SDL_OutOfMemory();
|
||||||
|
SDL_free(device);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
SDL_zerop(data);
|
SDL_zerop(data);
|
||||||
|
|
Loading…
Reference in New Issue