More precisely, when my program quits, the state/settings of my app are to be written to a JSON file. Hence, in the destructor, I need to rely on JSON.ahk's JSON.Dump() to stringify my object.
Code: Select all
class AppState {
state_data:={} ;the object holding the state data
__New(filename) { ;initialize AppState from a file using JSON.Load() to convert JSON string data to a AHK object
...
}
...
__Delete() { ;destructor. Serializes app state using JSON.Dump() to stringify state_data object
...
}
}
state:=AppState("state.json")
GuiClose:
state:={} ;destroys object explicitly and calls destructor; but can we do without?
ExitApp