Browse Source

Some fixes from Luiz Americo, fixes destroy

michael 21 years ago
parent
commit
7452bd955c
1 changed files with 2 additions and 1 deletions
  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);