WinRT: Removed dead code and fixed memory leak if allocation for driver failed.
This commit is contained in:
parent
7d41ef944e
commit
e8db21aaa3
1 changed files with 1 additions and 3 deletions
|
@ -118,15 +118,13 @@ WINRT_CreateDevice(int devindex)
|
|||
device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
|
||||
if (!device) {
|
||||
SDL_OutOfMemory();
|
||||
if (device) {
|
||||
SDL_free(device);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
data = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
|
||||
if (!data) {
|
||||
SDL_OutOfMemory();
|
||||
SDL_free(device);
|
||||
return (0);
|
||||
}
|
||||
SDL_zerop(data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue