Commit 2cd2d8f5 authored by Rich Prohaska's avatar Rich Prohaska

#206 fix memory leaks in lock tree tests

parent cdf8a8aa
......@@ -161,7 +161,9 @@ void lock_request_unit_test::test_wait_time_callback(void) {
release_lock_and_retry_requests(&lt, txnid_a, one, one);
request_a.destroy();
lt.create(nullptr, dict_id, nullptr, compare_dbts);
lt.release_reference();
lt.destroy();
}
} /* namespace toku */
......
......@@ -157,6 +157,9 @@ void lock_request_unit_test::test_wait_time_callback(void) {
release_lock_and_retry_requests(&lt, txnid_a, one, one);
request_a.destroy();
lt.release_reference();
lt.destroy();
}
} /* namespace toku */
......
......@@ -158,6 +158,9 @@ void lock_request_unit_test::test_start_deadlock(void) {
request_a.destroy();
request_b.destroy();
request_c.destroy();
lt.release_reference();
lt.destroy();
}
} /* namespace toku */
......
......@@ -144,6 +144,9 @@ void lock_request_unit_test::test_start_pending(void) {
locktree_unit_test::locktree_test_release_lock(&lt, txnid_a, one, one);
request.destroy();
lt.release_reference();
lt.destroy();
}
} /* namespace toku */
......
......@@ -134,6 +134,9 @@ void lock_request_unit_test::test_wait_time_callback(void) {
release_lock_and_retry_requests(&lt, txnid_a, one, one);
request_a.destroy();
lt.release_reference();
lt.destroy();
}
} /* namespace toku */
......
......@@ -165,6 +165,9 @@ void locktree_unit_test::test_conflicts(void) {
lt.remove_overlapping_locks_for_txnid(txnid_a, three, four);
invariant(no_row_locks(&lt));
}
lt.release_reference();
lt.destroy();
}
} /* namespace toku */
......
......@@ -112,6 +112,9 @@ void locktree_unit_test::test_create_destroy(void) {
invariant(info->pending_lock_requests.size() == 0);
invariant(lt.m_sto_end_early_count == 0);
invariant(lt.m_sto_end_early_time == 0);
lt.release_reference();
lt.destroy();
}
} /* namespace toku */
......
......@@ -162,6 +162,9 @@ void locktree_unit_test::test_infinity(void) {
invariant(r == DB_LOCK_NOTGRANTED);
lt.remove_overlapping_locks_for_txnid(txnid_a, toku_dbt_negative_infinity(), toku_dbt_positive_infinity());
lt.release_reference();
lt.destroy();
}
} /* namespace toku */
......
......@@ -134,6 +134,9 @@ void locktree_unit_test::test_misc(void) {
expected_descriptor = &d2;
r = lt.m_cmp->compare(&dbt_a, &dbt_b);
invariant(r == expected_comparison_magic);
lt.release_reference();
lt.destroy();
}
} /* namespace toku */
......
......@@ -203,6 +203,9 @@ void locktree_unit_test::test_overlapping_relock(void) {
// remove the other txnid's lock now
lt.remove_overlapping_locks_for_txnid(the_other_txnid, hundred, hundred);
lt.release_reference();
lt.destroy();
}
} /* namespace toku */
......
......@@ -169,6 +169,9 @@ void locktree_unit_test::test_single_txnid_optimization(void) {
buffer.destroy();
}
lt.release_reference();
lt.destroy();
}
} /* namespace toku */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment