newsbot
22.10.2023, 05:23
Автор: evil-at-wow
Improve Database API to avoid memory leaks in the future, part 2.Given the caller takes ownership of the query result that***39;s returned byDatabase::PQuery(), let***39;s return a unique_ptr instead of a raw pointer.This makes the ownership clear in the API and avoids memory leaks whenthe caller doesn***39;t delete the pointer in all scenarios (think earlyreturn or exceptions).
Подробнее... (https://github.com/cmangos/mangos-wotlk/commit/940fc26a12d472ddea8af18485585b0b8ae97389)
Improve Database API to avoid memory leaks in the future, part 2.Given the caller takes ownership of the query result that***39;s returned byDatabase::PQuery(), let***39;s return a unique_ptr instead of a raw pointer.This makes the ownership clear in the API and avoids memory leaks whenthe caller doesn***39;t delete the pointer in all scenarios (think earlyreturn or exceptions).
Подробнее... (https://github.com/cmangos/mangos-wotlk/commit/940fc26a12d472ddea8af18485585b0b8ae97389)