Thread not releasing resources?
-
I am using the TaskbarNotifier class to display incoming TCP/IP messages. I listen for a message on a port and when one is received, I start a thread that creates a new TaskbarNotifier object and shows the message. However, looking at Windows' Task Manager, I've noticed that the GDI Objects continue to grow (by 2 objects each time I am notified), even though the thread appears to end successfully (the thread count in task manager remains a constant 4). If I call create TaskbarNotifier in the same thread as my TCP/IP listener, the resources don't grow, but the port is blocked until the notifier finishes. Calling the thread without creading a TaskbarNotifier object also does not create growing resources. Adding the single line: TaskbarNotifier taskbarNotifier1 = new TaskbarNotifier(); to the thread class will cause the problem. If i set taskbarNotifier1 = null, it has no effect. Any ideas welcome.