I have a application which download or send files. Every operation like this is handled in different thread. Now I created a window which shows progress bars for each operation of that type. Progress bars are updated from within thread of given operation and because of that I use g_idle_add in them with gtk_progress_bar_set_fraction and other progress bar's related functions.
Everything worked fine but I wanted to allow user to delete progress bar by clicking on icon next to them and now I have a problem because when users clicks icon he closes thread of clicked operation but g_idle_add is still in run(because it attachs itself to main thread - it doesn't end itself when thread ends) and tries to update progress bar that doesn't exists anymore so I get Access Violation and I don't know how to redesign that part of my application to make it work.
Maybe there is a function which returns if any extra sources are attached to main loop? I am reading documentation but can't find anything like that.
Any suggestions/designed/ideas/anything highly appreciated.
before deleting progress bars resolved problem.