Browse Source

* Patch by Martin Friebe: mark duplicated handle for close instead of original

Michaël Van Canneyt 1 năm trước cách đây
mục cha
commit
d3b8aa728e
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      packages/fcl-process/src/win/process.inc

+ 3 - 2
packages/fcl-process/src/win/process.inc

@@ -370,8 +370,9 @@ begin
     DUPLICATE_SAME_ACCESS
   );
   if Res then begin
-    if (IOType=iotHandle) and not FAutoCloseCustomHandle then
-      FCloseHandleOnExecute:=True // AutoCloseCustomHandle protects the original Handle
+    // Either AutoCloseCustomHandle or set in OnGetHandle
+    if (IOType=iotHandle) and not FCloseHandleOnExecute then
+      FCloseHandleOnExecute:=True // the original CustomHandle is kept open / Set True for the duplicate handle
     else
       Res:=CloseHandle(oldHandle);
   end;