diff --git a/TSDocxToPdf.tsf b/TSDocxToPdf.tsf index 3fc2bc9..a8e6a8a 100644 --- a/TSDocxToPdf.tsf +++ b/TSDocxToPdf.tsf @@ -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; diff --git a/utils/TSPdfSingletonKit.tsf b/utils/TSPdfSingletonKit.tsf index e0dfe7e..5ea727f 100644 --- a/utils/TSPdfSingletonKit.tsf +++ b/utils/TSPdfSingletonKit.tsf @@ -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();