From: plugwash Date: Sun, 15 Feb 2009 03:11:49 +0000 (+0000) Subject: fix a bug in dispatchmessage X-Git-Url: http://www.lcore.org/git/lcore.git/commitdiff_plain/1066f857936e27fbf24d6b96b5be7703a2c0b0bf fix a bug in dispatchmessage git-svn-id: file:///svnroot/lcore/trunk@38 b1de8a11-f9be-4011-bde0-cc7ace90066a --- diff --git a/lmessages.pas b/lmessages.pas index 1b7db62..d6e3745 100755 --- a/lmessages.pas +++ b/lmessages.pas @@ -409,11 +409,15 @@ begin //we have to get the window procedure while the structurelock //is still held as the window could be destroyed from another thread //otherwise. - windowproc := window.windowproc; + if window <> nil then begin + windowproc := window.windowproc; + end else begin + windowproc := nil; + end; finally structurelock.release; end; - if window <> nil then begin + if windowproc <> nil then begin result := windowproc(lpmsg.hwnd,lpmsg.message,lpmsg.wparam,lpmsg.lparam); end else begin result := -1;