Browse Source

* added try..finally to beginupdate/endupdate, mantis #29165

git-svn-id: trunk@32629 -
marco 9 years ago
parent
commit
aa33a9509f
1 changed files with 9 additions and 6 deletions
  1. 9 6
      rtl/objpas/classes/stringl.inc

+ 9 - 6
rtl/objpas/classes/stringl.inc

@@ -951,12 +951,15 @@ Var
   Str : String;
   Str : String;
 begin
 begin
   BeginUpdate;
   BeginUpdate;
-  Obj:=Objects[CurIndex];
-  Str:=Strings[CurIndex];
-  Objects[CurIndex]:=Nil; // Prevent Delete from freeing.
-  Delete(Curindex);
-  InsertObject(NewIndex,Str,Obj);
-  EndUpdate;
+  Try
+    Obj:=Objects[CurIndex];
+    Str:=Strings[CurIndex];
+    Objects[CurIndex]:=Nil; // Prevent Delete from freeing.
+    Delete(Curindex);
+    InsertObject(NewIndex,Str,Obj);
+  finally
+    EndUpdate;
+    end;
 end;
 end;