From 1066f857936e27fbf24d6b96b5be7703a2c0b0bf Mon Sep 17 00:00:00 2001 From: plugwash Date: Sun, 15 Feb 2009 03:11:49 +0000 Subject: [PATCH 1/1] fix a bug in dispatchmessage git-svn-id: file:///svnroot/lcore/trunk@38 b1de8a11-f9be-4011-bde0-cc7ace90066a --- lmessages.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; -- 2.30.2