fix a bug in dispatchmessage
authorplugwash <plugwash@p10link.net>
Sun, 15 Feb 2009 03:11:49 +0000 (03:11 +0000)
committerplugwash <plugwash@p10link.net>
Sun, 15 Feb 2009 03:11:49 +0000 (03:11 +0000)
git-svn-id: file:///svnroot/lcore/trunk@38 b1de8a11-f9be-4011-bde0-cc7ace90066a

lmessages.pas

index 1b7db62b6380bc046dc64b41b2c85a68cad90f86..d6e3745b770868fe5746fedb1bfb3f9c2a049437 100755 (executable)
@@ -409,11 +409,15 @@ begin
       //we have to get the window procedure while the structurelock\r
       //is still held as the window could be destroyed from another thread\r
       //otherwise.\r
-      windowproc := window.windowproc;\r
+      if window <> nil then begin
+        windowproc := window.windowproc;\r
+      end else begin
+        windowproc := nil;
+      end;
     finally\r
       structurelock.release;\r
     end;\r
-    if window <> nil then begin\r
+    if windowproc <> nil then begin\r
       result := windowproc(lpmsg.hwnd,lpmsg.message,lpmsg.wparam,lpmsg.lparam);\r
     end else begin\r
       result := -1;\r