PDA

Просмотр полной версии : Improve Database API to avoid memory leaks in the future, part 1.


newsbot
22.10.2023, 05:23
Автор: evil-at-wow

Improve Database API to avoid memory leaks in the future, part 1.Given the caller takes ownership of the query result that***39;s returned byDatabase::Query(), 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/dbbd3fe008d6890b2cb647acaacd5c9546821ca6)