Unify code for refreshing Virtual Trees in a new helper method InvalidateVT. Fixes issue #1789 and issue #1790.

* Don't try to access a passed tree if it has been destroyed by some earlier event.
* Don't try to access registry in DoDisconnect after key has been closed.
* Now that DoDisconnect lives in FormDestroy it is save to call it slightly earlier, before registry has been closed. There should be no later paint events which will trigger random database queries.
This commit is contained in:
Ansgar Becker
2010-03-21 10:43:16 +00:00
parent 3168a3e277
commit be645ac79b
4 changed files with 60 additions and 76 deletions

View File

@ -315,8 +315,7 @@ procedure TDataSortingForm.btnOKClick(Sender: TObject);
begin
// TODO: apply ordering
Mainform.DataGridSortColumns := OrderColumns;
Mainform.DataGrid.Tag := VTREE_NOTLOADED_PURGECACHE;
Mainform.DataGrid.Invalidate;
InvalidateVT(Mainform.DataGrid, VTREE_NOTLOADED_PURGECACHE, False);
btnCancel.OnClick(Sender);
end;