JCommunique icon indicating copy to clipboard operation
JCommunique copied to clipboard

NotificationManager leaves hanging timer threads

Open erieflin opened this issue 6 years ago • 2 comments

When creating a notification via plain.addNotification(notification, Time.seconds(2));

A timer thread is created and never cleaned up (likely RemoveTimer at notificationManager line 64)

After the notification closes the thread remains running in memory until application termination, causing resource leak and preventing application close without system.exit().

This is easily visible debugging the demo app code in eclipse and watching the threads created.

This problem can be worked around by the following code block

        plain.addNotification(notification, Time.infinite());
	Thread.sleep(2000);
	plain.removeNotification(notification);

Resulting in no lingering thread and system terminating properly upon successful completion.

I will use this work around for my personal uses, I am creating this issue to document the workaround and the problem.

erieflin avatar Jul 24 '18 19:07 erieflin

Will be fixed?

benchdoos avatar Apr 27 '19 19:04 benchdoos

or simple System.exit(0);

s0c1aleng1n avatar Jun 25 '19 10:06 s0c1aleng1n