shape: Free platform-specific shaped window data.

Fixes #2128.
This commit is contained in:
Ryan C. Gordon
2022-10-25 23:13:34 -04:00
parent 30c2dac787
commit c8d20f96ba
5 changed files with 47 additions and 3 deletions

View File

@@ -34,6 +34,7 @@
#include "SDL_windowsvideo.h"
#include "SDL_windowswindow.h"
#include "SDL_windowsshape.h"
#include "SDL_hints.h"
#include "SDL_timer.h"
@@ -1168,6 +1169,18 @@ WIN_SetWindowKeyboardGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
void
WIN_DestroyWindow(_THIS, SDL_Window * window)
{
if (window->shaper) {
SDL_ShapeData *shapedata = (SDL_ShapeData *) window->shaper->driverdata;
if (shapedata) {
if (shapedata->mask_tree) {
SDL_FreeShapeTree(&shapedata->mask_tree);
}
SDL_free(shapedata);
}
SDL_free(window->shaper);
window->shaper = NULL;
}
CleanupWindowData(_this, window);
}