Преглед на файлове

Some fixes from Luiz Americo, fixes destroy

michael преди 21 години
родител
ревизия
7452bd955c
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      fcl/db/sqlite/sqliteds.pas

+ 2 - 1
fcl/db/sqlite/sqliteds.pas

@@ -256,11 +256,11 @@ end;
 
 destructor TSqliteDataset.Destroy;
 begin
+  inherited Destroy;
   FUpdatedItems.Destroy;
   FAddedItems.Destroy;
   FDeletedItems.Destroy;
   FOrphanItems.Destroy;
-  inherited Destroy;
 end;
 
 procedure TSqliteDataset.DisposeLinkedList;
@@ -560,6 +560,7 @@ var
   TempStr:String;
   ActiveItem:PDataRecord;
 begin
+  if FRecordCount = 0 then exit; //avoid exception in win32 + lcl + TDbEdit
   ActiveItem:=PPDataRecord(ActiveBuffer)^;
   if (ActiveItem <> FCacheItem) and (FUpdatedItems.IndexOf(ActiveItem) = -1) and (FAddedItems.IndexOf(ActiveItem) = -1) then
     FUpdatedItems.Add(ActiveItem);