Browse Source

* Only free event if it was actually created

Michaël Van Canneyt 1 year ago
parent
commit
cb7a8dfea7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      packages/fcl-base/src/syncobjs.pp

+ 2 - 1
packages/fcl-base/src/syncobjs.pp

@@ -412,7 +412,8 @@ end;
 
 destructor THandleObject.Destroy;
 begin
-  BasicEventDestroy(Handle);
+  if (Handle<>Nil) then
+    BasicEventDestroy(Handle);
 end;
 
 constructor TEventObject.Create(EventAttributes : PSecurityAttributes;