* Fix AV in some cases. reported by Pascal Riekenberg

This commit is contained in:
Michaël Van Canneyt 2023-12-21 13:31:07 +01:00
parent f232009010
commit 5f845aa8ff

View File

@ -454,8 +454,8 @@ end;
procedure TDBTransaction.SetDatabase(Value: TDatabase);
begin
If Value<>FDatabase then
begin
If Value=FDatabase then
exit;
CheckInactive;
If Assigned(FDatabase) then
FDatabase.UnregisterTransaction(Self);
@ -463,7 +463,6 @@ begin
Value.RegisterTransaction(Self);
FDatabase:=Value;
end;
end;
constructor TDBTransaction.Create(AOwner: TComponent);
@ -523,9 +522,9 @@ end;
destructor TDBTransaction.Destroy;
begin
Database:=Nil;
CloseDataSets;
RemoveDatasets;
Database:=Nil;
FDatasets.Free;
Inherited;
end;