diff src/video/x11/SDL_x11events.c @ 2323:4ac07ae446d3

Fixed many valgrind errors. But, I broke testdyngl.
author Bob Pendleton <bob@pendleton.com>
date Thu, 06 Mar 2008 23:07:02 +0000
parents 1a8bab15a45d
children 3202e4826c57
line wrap: on
line diff
--- a/src/video/x11/SDL_x11events.c	Thu Mar 06 17:08:10 2008 +0000
+++ b/src/video/x11/SDL_x11events.c	Thu Mar 06 23:07:02 2008 +0000
@@ -51,10 +51,15 @@
     }
 
     data = NULL;
-    for (i = 0; i < videodata->numwindows; ++i) {
-        if (videodata->windowlist[i]->window == xevent.xany.window) {
-            data = videodata->windowlist[i];
+    if (videodata && 
+        videodata->windowlist) {
+      for (i = 0; i < videodata->numwindows; ++i) {
+        if ((videodata->windowlist[i] != NULL) &&
+            (videodata->windowlist[i]->window == xevent.xany.window)) {
+          data = videodata->windowlist[i];
+          break;
         }
+      }
     }
     if (!data) {
         return;