Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct node deletion logic when disposing of sciview #525

Merged
merged 1 commit into from
Jul 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/kotlin/sc/iview/SciView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ class SciView : SceneryBase, CalibratedRealInterval<CalibratedAxis> {
* @param activePublish whether the deletion should be published
*/
@JvmOverloads
fun deleteNode(node: Node?, activePublish: Boolean = true) {
fun deleteNode(node: Node?, activePublish: Boolean = true) {
if(node is Volume) {
node.volumeManager.remove(node)
val toRemove = ArrayList<Any>()
Expand Down Expand Up @@ -1210,7 +1210,7 @@ fun deleteNode(node: Node?, activePublish: Boolean = true) {
fun dispose() {
val objs: List<Node> = objectService.getObjects(Node::class.java)
for (obj in objs) {
objectService.removeObject(obj)
deleteNode(obj, activePublish = false)
}
scijavaContext!!.service(SciViewService::class.java).close(this)
close()
Expand Down
Loading