Code: Select all
TUniSQLMonitor.Create
TCustomDASQLMonitor.Create
TCustomDASQLMonitor.SetActive
TCustomDASQLMonitor.RegisterClient (*)
Because we are inside "TUniSQLMonitor.Create", global variable UniSQLMonitor.UniMonitor is not yet initialized by "Self"!
GetMonitor results NIL and registering SQL monitor client fails.
If think, the best (and the simplest) solution is to move instruction:
Code: Select all
if (csDesigning in ComponentState) or (AOwner = nil) or not (csReading in AOwner.ComponentState) then
Active := True