X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/2940bfc96468965b57663b231695179dbbd3baca..1066f857936e27fbf24d6b96b5be7703a2c0b0bf:/lmessages.pas?ds=sidebyside 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;