| 522 | return true; |
| 523 | } |
| 524 | void ReShadeUnregisterAddon(void *module) |
| 525 | { |
| 526 | if (module == nullptr || module == g_module_handle) |
| 527 | return; |
| 528 | |
| 529 | reshade::addon_info *const info = reshade::find_addon(module); |
| 530 | if (info == nullptr) |
| 531 | return; |
| 532 | |
| 533 | // Unregister all event callbacks registered by this add-on |
| 534 | while (!info->event_callbacks.empty()) |
| 535 | { |
| 536 | const auto &last_event_callback = info->event_callbacks.back(); |
| 537 | ReShadeUnregisterEvent(static_cast<reshade::addon_event>(last_event_callback.first), last_event_callback.second); |
| 538 | } |
| 539 | |
| 540 | #if RESHADE_GUI |
| 541 | // Unregister all overlay callbacks associated with this add-on |
| 542 | while (!info->overlay_callbacks.empty()) |
| 543 | { |
| 544 | const auto &last_overlay_callback = info->overlay_callbacks.back(); |
| 545 | ReShadeUnregisterOverlay(last_overlay_callback.title.c_str(), last_overlay_callback.callback); |
| 546 | } |
| 547 | #endif |
| 548 | |
| 549 | reshade::log::message(reshade::log::level::info, "Unregistered add-on \"%s\".", info->name.c_str()); |
| 550 | |
| 551 | reshade::addon_loaded_info.erase(reshade::addon_loaded_info.begin() + (info - reshade::addon_loaded_info.data())); |
| 552 | } |
| 553 | |
| 554 | void ReShadeRegisterEvent(reshade::addon_event ev, void *callback) |
| 555 | { |
no test coverage detected