[SOLVED] Why is this causing a leak detection when closing the exported app?
-
To make it short, I check if the pref file is present, if yes -> load it, if not -> create it, check again and load
Does this count as a cyclic ref?
The exception is thrown only when closing the appconst var prefFile = FileSystem.getFolder(FileSystem.AppData).getChildFile("pref.sfts"); inline function load() { if (prefFile.isFile()) { local decryptedPrefFile = prefFile.loadEncryptedObject(PREF_FILE_PIN); if (isDefined(decryptedPrefFile.showInfo)) { // whatever } } else create(); } load(); inline function create() { prefFile.writeEncryptedObject(preferences, PREF_FILE_PIN); load(); // <= good or bad? }
-
@ustk Sometimes I just think too much...
Or not enough!inline function load() { if (!prefFile.isFile()) prefFile.writeEncryptedObject(preferences, PREF_FILE_PIN); local decryptedPrefFile = prefFile.loadEncryptedObject(PREF_FILE_PIN); if (isDefined(decryptedPrefFile.showInfo)) { // whatever } } load();