summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/corelib/fpg_msgqueue.inc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/corelib/fpg_msgqueue.inc b/src/corelib/fpg_msgqueue.inc
index 386178d9..00862cc1 100644
--- a/src/corelib/fpg_msgqueue.inc
+++ b/src/corelib/fpg_msgqueue.inc
@@ -86,10 +86,15 @@ end;
function fpgGetFirstMessage: PfpgMessageRec;
begin
- if UsedFirstMessage <> nil then
- Result := @(UsedFirstMessage.msg)
- else
- Result := nil;
+ fpgApplication.Lock;
+ try
+ if UsedFirstMessage <> nil then
+ Result := @(UsedFirstMessage.msg)
+ else
+ Result := nil;
+ finally
+ fpgApplication.Unlock;
+ end;
end;
procedure fpgInitMsgQueue;