Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: on_playlists_removed called when foobar closes? (Read 2545 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

on_playlists_removed called when foobar closes?

When foobar is closed, on_playlists_removed is called with p_new_count being zero. It's confirmed by putting the following code at the beginning of the body of the on_playlists_removed method. Is this intended?

FILE* fp = fopen("test", "a");
fprintf(fp, "%d, %d ", p_old_count, p_new_count);

 

on_playlists_removed called when foobar closes?

Reply #1
Yes. If this inconveniences you, you have to check whether foobar2000 is shutting down. How you should do this depends on your implementation. If your playlist_callback is registered dynamically, the easiest way would be to unregister it in initquit::on_quit().

By the way, if you use a statically registered callback, you will also get on_playlist_added() calls before initquit::on_init().