The Generator class is semi-stateless, but it holds onto an analyser model when it is asked to perform a function. Making the class fully stateless will remove ambiguity around which analyserModel is currently held as there is no way for the user to know this, wrt. the Generator class.
The Generator class is also not an owner of the AnalyserModel and shouldn’t keep a reference to it.
The Generator class can either hold a weak pointer to the AnalyserModel or drop its reference when it has finished with it.
This issue seeks to either stop mAnalyserModel holding a reference beyond the current function call or retain only a weak pointer. Also make equationCode functions take an analyserModel as a first argument.
The Generator class is semi-stateless, but it holds onto an analyser model when it is asked to perform a function. Making the class fully stateless will remove ambiguity around which analyserModel is currently held as there is no way for the user to know this, wrt. the Generator class.
The Generator class is also not an owner of the AnalyserModel and shouldn’t keep a reference to it.
The Generator class can either hold a weak pointer to the AnalyserModel or drop its reference when it has finished with it.
This issue seeks to either stop mAnalyserModel holding a reference beyond the current function call or retain only a weak pointer. Also make equationCode functions take an analyserModel as a first argument.