Didn't quite fix the memory leak issue. There are still many memory leaks.
However I did an experiment where I did not create an EnvironmentObject (nor pass one into any views). This resulted in 0 memory leaks. However this also caused UI to not update responsively in real time.
Therefore, the culprit of the memory leaks is the EnvironmentObject of type UserData (referred to as userDataEnvObj in the subviews). Not sure why it is causing bad memory leaks but will look into this further.
Didn't quite fix the memory leak issue. There are still many memory leaks.
However I did an experiment where I did not create an EnvironmentObject (nor pass one into any views). This resulted in 0 memory leaks. However this also caused UI to not update responsively in real time.
Therefore, the culprit of the memory leaks is the EnvironmentObject of type UserData (referred to as userDataEnvObj in the subviews). Not sure why it is causing bad memory leaks but will look into this further.
issue #27