Skip to content

Commit

Permalink
Fixed memory handling issues in multitask module
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Aug 11, 2012
1 parent 949e7c9 commit c561e46
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Expand Up @@ -172,6 +172,10 @@ bool CMultitaskLeastSquaresRegression::train_machine(CFeatures* data)
SG_ERROR("Not supported task relation type\n");
}

for (int32_t i=0; i<options.n_tasks; i++)
options.tasks_indices[i].~SGVector<index_t>();
SG_FREE(options.tasks_indices);

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/shogun/transfer/multitask/TaskGroup.cpp
Expand Up @@ -23,7 +23,7 @@ CTaskGroup::~CTaskGroup()

void CTaskGroup::init()
{
m_tasks = new CDynamicObjectArray();
m_tasks = new CDynamicObjectArray(true);
}

void CTaskGroup::append_task(CTask* task)
Expand Down
1 change: 1 addition & 0 deletions src/shogun/transfer/multitask/TaskTree.cpp
Expand Up @@ -41,6 +41,7 @@ int32_t count_leaf_tasks_recursive(CTask* subtree_root_block)
do
{
sum += count_leaf_tasks_recursive(iterator);
SG_UNREF(iterator);
}
while ((iterator = (CTask*)sub_tasks->get_next_element()) != NULL);

Expand Down

0 comments on commit c561e46

Please sign in to comment.