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

Verify that services dispose in reverse order #58

Open
ctrueden opened this Issue May 6, 2014 · 0 comments

Comments

Projects
None yet
1 participant
@ctrueden
Copy link
Member

ctrueden commented May 6, 2014

When disposing the Context, services should be disposed in reverse order of their initialization. However, looking at the log entries and printing which services are closing you can see they close in a much different order. Make sure that services are closing in a safe orderly fashion.

The ServiceIndex is populated in the correct initialization order. However internally that class does not maintain the order since it is a SortedObjectIndex. So the call in Context#dispose() that walks the services in reverse order can't really know the correct order.

The ServiceIndex should be updated to keep a simple list of the services as they are initialized. They could then be easily disposed in reverse order by iterating the list in reverse.

Migrated-From: http://trac.imagej.net/ticket/2014

@ctrueden ctrueden changed the title Verify that services dispose in similar order to initialization Verify that services dispose in reverse order to initialization May 6, 2014

@ctrueden ctrueden changed the title Verify that services dispose in reverse order to initialization Verify that services dispose in reverse order May 6, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.