Sfoglia il codice sorgente

Tracing (tree loading)

Source commit: ac4740eca4fb0127b9fedb3197e3a430479293f6
Martin Prikryl 6 anni fa
parent
commit
9f30819dd9
1 ha cambiato i file con 16 aggiunte e 14 eliminazioni
  1. 16 14
      source/packages/dragndrop/DragDrop.pas

+ 16 - 14
source/packages/dragndrop/DragDrop.pas

@@ -1725,21 +1725,23 @@ begin
      finally
         // nothing to do
      end;
-     if FRegistered or (FTargetEffects=0) or (FDragDropControl=nil) then exit;
-     try
-        // CoLockObjectExternal crashes debugging intermittently in C++ Builder 2010
-        {$IFNDEF IDE}
-        // Ensure that drag-and-drop interface stays in memory
-        CoLockObjectExternal(FDropTarget, True, False);
-        {$ENDIF}
-        if RegisterDragDrop(FDragDropControl.Handle, IDropTarget(FDropTarget))=S_OK then
-        begin
-             Result:=True;
-             FRegistered:=True;
+     if (not FRegistered) and (FTargetEffects <> 0) and (FDragDropControl <> nil) then
+     begin
+        try
+           // CoLockObjectExternal crashes debugging intermittently in C++ Builder 2010
+           {$IFNDEF IDE}
+           // Ensure that drag-and-drop interface stays in memory
+           CoLockObjectExternal(FDropTarget, True, False);
+           {$ENDIF}
+           if RegisterDragDrop(FDragDropControl.Handle, IDropTarget(FDropTarget))=S_OK then
+           begin
+                Result:=True;
+                FRegistered:=True;
+           end;
+        except
+           Result:=false;
+           FRegistered:=false;
         end;
-     except
-        Result:=false;
-        FRegistered:=false;
      end;
 end;