1
0
mirror of synced 2025-01-30 03:27:25 +01:00

fix: Crash when deleting overlays

This commit is contained in:
WerWolv 2023-06-03 22:50:37 +02:00
parent aca949175d
commit 1dff81f7cd

View File

@ -21,8 +21,9 @@ namespace hex::prv {
}
Provider::~Provider() {
for (auto &overlay : this->m_overlays)
this->deleteOverlay(overlay);
for (auto overlay : this->m_overlays)
delete overlay;
this->m_overlays.clear();
}
void Provider::read(u64 offset, void *buffer, size_t size, bool overlays) {
@ -147,7 +148,7 @@ namespace hex::prv {
}
void Provider::deleteOverlay(Overlay *overlay) {
this->m_overlays.erase(std::find(this->m_overlays.begin(), this->m_overlays.end(), overlay));
this->m_overlays.remove(overlay);
delete overlay;
}