Fix memory leak in msg_openWindow

This commit is contained in:
kichikuou
2020-08-29 22:36:59 +09:00
parent 0bbace898d
commit dc8025469a
+6 -6
View File
@@ -263,10 +263,10 @@ void msg_openWindow(int W, int C1, int C2, int N, int M) {
case WINDOW_FRAME_EMPTY:
if (M == 0) {
/* show window */
if (msg.win->savedimg != NULL) {
ags_delRegion(msg.win->savedimg);
}
if (msg.win->save) {
if (msg.win->savedimg != NULL) {
ags_delRegion(msg.win->savedimg);
}
msg.win->savedimg = ags_saveRegion(msg.win->x, msg.win->y, msg.win->width, msg.win->height);
} else {
msg.win->savedimg = NULL;
@@ -283,10 +283,10 @@ void msg_openWindow(int W, int C1, int C2, int N, int M) {
case WINDOW_FRAME_LINE:
if (M == 0) {
/* show window*/
if (msg.win->savedimg != NULL) {
ags_delRegion(msg.win->savedimg);
}
if (msg.win->save) {
if (msg.win->savedimg != NULL) {
ags_delRegion(msg.win->savedimg);
}
msg.win->savedimg = ags_saveRegion(msg.win->x -8, msg.win->y -8, msg.win->width +16, msg.win->height +16);
} else {
msg.win->savedimg = NULL;