saalfeldlab / paintera

GNU General Public License v2.0
100 stars 17 forks source link

Release MeshGenerator resources when disposed #340

Closed hanslovsky closed 5 years ago

hanslovsky commented 5 years ago

Fixes #337

Before this commit, a listener would be added to the isManagedProperty of the meshSettings to update the MeshGenerator with appropriate global or individual MeshSettings. For some reason, this kept the internal JavaFX classes NGMeshView and MeshView alive, prohibiting clean-up of their resources, and, as a result, leaking memory. This commit fixes this issue by adding a meshSettingsProperty to the MeshGenerator that the caller can unbind to remove the listener that holds on to the MeshManager's resources.

hanslovsky commented 5 years ago

Not ready for merge, needs evaluation in a real work settings. Unfortunately, cannot convert existing PR into a draft.