X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/987e8123d8ba3201ed2690004cfefd7983ff7487..4e23b915756617cac9c6c413c14106d066085d74:/lmessages.pas?ds=inline diff --git a/lmessages.pas b/lmessages.pas index 1b7db62..3aafdca 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 assigned(windowproc) then begin result := windowproc(lpmsg.hwnd,lpmsg.message,lpmsg.wparam,lpmsg.lparam); end else begin result := -1;