Skip to content

Cleanup Timer prevents JVM shutdown? #4

Description

@void256

We've received several reports that a mysterious Timer task prevents some of the applications that use our lib (that internally uses the EventBus) prevents the JVM from closing properly (see nifty-gui/nifty-gui#365 or nifty-gui/nifty-gui#364)

Further investigation points to the cleanup Timer created in this line:

https://github.com/michaelbushe/EventBus/blob/master/src/org/bushe/swing/event/ThreadSafeEventService.java#L2100

   if (cleanupTimer == null) {
       cleanupTimer = new Timer();
   } 

Since this Timer is created as a non daemon Thread it is my understanding that while it is running it will in fact prevent the JVM from ending properly.

Could this line be changed to: new Timer(true) to prevent this behaviour or is there something we're missing?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions