新增对单例类的内存释放

This commit is contained in:
csh
2024-07-09 13:32:16 +08:00
parent 5fe2911608
commit 615f4a5b39
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -1,6 +1,7 @@
type TSPdfSingletonKit = class
public
function Create();
class function Release(components: Components);
class function GetComponent(components: Components; type: string);
public
hash_: array of tslobj;
@@ -14,6 +15,11 @@ begin
hash_ := array();
end;
class function TSPdfSingletonKit.Release(components: Components);
begin
singleton_.hash_[components] := nil;
end;
class function TSPdfSingletonKit.GetComponent(components: Components; type: string);
begin
if not ifObj(singleton_) then singleton_ := new TSPdfSingletonKit();