X11: Fixed memory leak when initializing multiple screens.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sat, 05 Dec 2015 17:08:07 +0100
changeset 9944 88608984f245
parent 9943 373454d9a695
child 9945 09d546e9d8a1
X11: Fixed memory leak when initializing multiple screens.
src/video/x11/SDL_x11modes.c
--- a/src/video/x11/SDL_x11modes.c	Fri Dec 04 22:12:36 2015 +0100
+++ b/src/video/x11/SDL_x11modes.c	Sat Dec 05 17:08:07 2015 +0100
@@ -491,11 +491,11 @@
                 display.driverdata = displaydata;
                 SDL_AddVideoDisplay(&display);
             }
+
+            X11_XRRFreeScreenResources(res);
         }
     }
 
-    X11_XRRFreeScreenResources(res);
-
     if (_this->num_displays == 0) {
         return SDL_SetError("No available displays");
     }