HydrogenAudio

Hosted Forums => foobar2000 => Development - (fb2k) => Topic started by: marc2k3 on 2024-02-29 01:28:28

Title: Using get_library_index() from on_library_initialized breaks everything.
Post by: marc2k3 on 2024-02-29 01:28:28
I thought this would be safe to do but it very much isn't...

Code: [Select]
class LibraryCallback : public library_callback_v2
{
public:
void on_library_initialized() final
{
auto index = search_index_manager::get()->get_library_index();
}

void on_items_added(metadb_handle_list_cref) final {}
void on_items_modified(metadb_handle_list_cref) final {}
void on_items_modified_v2(metadb_handle_list_cref, metadb_io_callback_v2_data&) final {}
void on_items_removed(metadb_handle_list_cref) final {}
};

FB2K_SERVICE_FACTORY(LibraryCallback);

It prevents stock album list from populating itself which is um.... not good. The original bug report came from someone using Columns/foo_uie_albumlist and the mere presence of my component which contains the above code was the cause of that not updating itself as well. I isolated it down to that one line.