From: <ah...@us...> - 2009-09-19 12:03:20
|
Revision: 12507 http://jvcl.svn.sourceforge.net/jvcl/?rev=12507&view=rev Author: ahuser Date: 2009-09-19 12:03:14 +0000 (Sat, 19 Sep 2009) Log Message: ----------- JvAppStorage initialization caused SmartLinker to always include all the classes Modified Paths: -------------- trunk/jvcl/run/JvAppStorage.pas Modified: trunk/jvcl/run/JvAppStorage.pas =================================================================== --- trunk/jvcl/run/JvAppStorage.pas 2009-09-19 12:01:43 UTC (rev 12506) +++ trunk/jvcl/run/JvAppStorage.pas 2009-09-19 12:03:14 UTC (rev 12507) @@ -980,8 +980,17 @@ end; var - RegisteredAppStoragePropertyEngineList: TJvAppStoragePropertyEngineList; + GlobalRegisteredAppStoragePropertyEngineList: TJvAppStoragePropertyEngineList; + GlobalRegisteredAppStoragePropertyEngineListDestroyed: Boolean; +function RegisteredAppStoragePropertyEngineList: TJvAppStoragePropertyEngineList; +begin + if (GlobalRegisteredAppStoragePropertyEngineList = nil) and + not GlobalRegisteredAppStoragePropertyEngineListDestroyed then + GlobalRegisteredAppStoragePropertyEngineList := TJvAppStoragePropertyEngineList.Create; + Result := GlobalRegisteredAppStoragePropertyEngineList; +end; + const // (rom) this name is shared in several units and should be made global cCount = 'Count'; @@ -2635,7 +2644,7 @@ tkClass: begin SubObj := GetObjectProp(PersObj, PropName); - if Assigned(RegisteredAppStoragePropertyEngineList) and + if (RegisteredAppStoragePropertyEngineList <> nil) and Recursive and RegisteredAppStoragePropertyEngineList.ReadProperty(Self, Path, PersObj, SubObj, Recursive, ClearFirst) then // Do nothing else, the handling is done in the ReadProperty procedure @@ -2774,7 +2783,7 @@ tkClass: begin SubObj := GetObjectProp(PersObj, PropName); - if Assigned(RegisteredAppStoragePropertyEngineList) and + if (RegisteredAppStoragePropertyEngineList <> nil) and Recursive and RegisteredAppStoragePropertyEngineList.WriteProperty(Self, Path, PersObj, SubObj, Recursive) then begin @@ -3685,32 +3694,27 @@ procedure RegisterAppStoragePropertyEngine(AEngineClass: TJvAppStoragePropertyBaseEngineClass); begin - if Assigned(RegisteredAppStoragePropertyEngineList) then + if RegisteredAppStoragePropertyEngineList <> nil then RegisteredAppStoragePropertyEngineList.RegisterEngine(AEngineClass); end; procedure UnregisterAppStoragePropertyEngine(AEngineClass: TJvAppStoragePropertyBaseEngineClass); begin - if Assigned(RegisteredAppStoragePropertyEngineList) then + if RegisteredAppStoragePropertyEngineList <> nil then RegisteredAppStoragePropertyEngineList.UnregisterEngine(AEngineClass); end; -procedure CreateAppStoragePropertyEngineList; -begin - RegisteredAppStoragePropertyEngineList := TJvAppStoragePropertyEngineList.Create; -end; - procedure DestroyAppStoragePropertyEngineList; begin - RegisteredAppStoragePropertyEngineList.Free; - RegisteredAppStoragePropertyEngineList := nil; + GlobalRegisteredAppStoragePropertyEngineListDestroyed := True; + GlobalRegisteredAppStoragePropertyEngineList.Free; + GlobalRegisteredAppStoragePropertyEngineList := nil; end; initialization {$IFDEF UNITVERSIONING} RegisterUnitVersion(HInstance, UnitVersioning); {$ENDIF UNITVERSIONING} - CreateAppStoragePropertyEngineList; finalization DestroyAppStoragePropertyEngineList; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |