新增对单例类的内存释放
This commit is contained in:
@@ -58,6 +58,7 @@ end;
|
||||
function TSDocxToPdf.Destroy();
|
||||
begin
|
||||
removeDir("", cache_path_);
|
||||
class(TSPdfSingletonKit).Release(docx_components_);
|
||||
end;
|
||||
|
||||
function TSDocxToPdf.SaveToFile(alias: string; file: string): integer;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user