[DEV] update to the new ETK allocator wrapper

This commit is contained in:
2017-10-21 19:07:42 +02:00
parent b6e3bce68f
commit 40339d34bd
5 changed files with 155 additions and 10 deletions

View File

@@ -28,7 +28,7 @@ void appl::TagFileList::init() {
appl::TagFileList::~TagFileList() {
for (auto &it : m_list) {
delete(it);
ETK_DELETE(appl::TagListElement, it);
it = nullptr;
}
}
@@ -109,7 +109,7 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum gale::key::status _ty
* @param[in] jump line id
*/
void appl::TagFileList::add(etk::String& _file, int32_t _line) {
appl::TagListElement *tmpFile = new appl::TagListElement(_file, _line);
appl::TagListElement *tmpFile = ETK_NEW(appl::TagListElement, _file, _line);
if (nullptr != tmpFile) {
m_list.pushBack(tmpFile);
}

View File

@@ -43,7 +43,7 @@ namespace appl {
}
++it;
}
ememory::UniquePtr<TYPE> data(new TYPE());
ememory::UniquePtr<TYPE> data(ETK_NEW(TYPE));
if (data == nullptr) {
APPL_ERROR("ALLOCATION plugin data error");
return nullptr;

View File

@@ -97,7 +97,7 @@ void appl::TextPluginHistory::clearRedo(appl::PluginHistoryData& _data) {
if (_data.m_redo[iii] == nullptr) {
continue;
}
delete(_data.m_redo[iii]);
ETK_DELETE(appl::History, _data.m_redo[iii]);
_data.m_redo[iii] = nullptr;
}
_data.m_redo.clear();
@@ -111,7 +111,7 @@ void appl::TextPluginHistory::clearUndo(appl::PluginHistoryData& _data) {
if (_data.m_undo[iii] == nullptr) {
continue;
}
delete(_data.m_undo[iii]);
ETK_DELETE(appl::History, _data.m_undo[iii]);
_data.m_undo[iii] = nullptr;
}
_data.m_undo.clear();
@@ -125,7 +125,7 @@ bool appl::TextPluginHistory::onDataWrite(appl::TextViewer& _textDrawer,
if (isEnable() == false) {
return false;
}
appl::History *tmpElement = new appl::History();
appl::History *tmpElement = ETK_NEW(appl::History);
if (tmpElement != nullptr) {
tmpElement->m_addedText = _strData;
tmpElement->m_posAdded = (int64_t)_pos;
@@ -154,7 +154,7 @@ bool appl::TextPluginHistory::onDataReplace(appl::TextViewer& _textDrawer,
if (isEnable() == false) {
return false;
}
appl::History *tmpElement = new appl::History();
appl::History *tmpElement = ETK_NEW(appl::History);
if (tmpElement != nullptr) {
tmpElement->m_posAdded = (int64_t)_pos;
tmpElement->m_addedText = _strData;
@@ -181,7 +181,7 @@ bool appl::TextPluginHistory::onDataRemove(appl::TextViewer& _textDrawer,
if (isEnable() == false) {
return false;
}
appl::History *tmpElement = new appl::History();
appl::History *tmpElement = ETK_NEW(appl::History);
if (tmpElement != nullptr) {
tmpElement->m_addedText = "";
tmpElement->m_posAdded = (int64_t)_pos;

View File

@@ -167,7 +167,7 @@ int main(int _argc, const char *_argv[]) {
APPL_CRITICAL(" END ");
*/
// second possibility
return ewol::run(new MainApplication(), _argc, _argv);
return ewol::run(ETK_NEW(MainApplication), _argc, _argv);
}