Commit cd4b1cd7 authored by Rich Prohaska's avatar Rich Prohaska

#206 fix memory leaks in lock tree tests

parent eb340a90
...@@ -161,7 +161,9 @@ void lock_request_unit_test::test_wait_time_callback(void) { ...@@ -161,7 +161,9 @@ void lock_request_unit_test::test_wait_time_callback(void) {
release_lock_and_retry_requests(&lt, txnid_a, one, one); release_lock_and_retry_requests(&lt, txnid_a, one, one);
request_a.destroy(); request_a.destroy();
lt.create(nullptr, dict_id, nullptr, compare_dbts);
lt.release_reference();
lt.destroy();
} }
} /* namespace toku */ } /* namespace toku */
......
...@@ -157,6 +157,9 @@ void lock_request_unit_test::test_wait_time_callback(void) { ...@@ -157,6 +157,9 @@ void lock_request_unit_test::test_wait_time_callback(void) {
release_lock_and_retry_requests(&lt, txnid_a, one, one); release_lock_and_retry_requests(&lt, txnid_a, one, one);
request_a.destroy(); request_a.destroy();
lt.release_reference();
lt.destroy();
} }
} /* namespace toku */ } /* namespace toku */
......
...@@ -158,6 +158,9 @@ void lock_request_unit_test::test_start_deadlock(void) { ...@@ -158,6 +158,9 @@ void lock_request_unit_test::test_start_deadlock(void) {
request_a.destroy(); request_a.destroy();
request_b.destroy(); request_b.destroy();
request_c.destroy(); request_c.destroy();
lt.release_reference();
lt.destroy();
} }
} /* namespace toku */ } /* namespace toku */
......
...@@ -144,6 +144,9 @@ void lock_request_unit_test::test_start_pending(void) { ...@@ -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); locktree_unit_test::locktree_test_release_lock(&lt, txnid_a, one, one);
request.destroy(); request.destroy();
lt.release_reference();
lt.destroy();
} }
} /* namespace toku */ } /* namespace toku */
......
...@@ -134,6 +134,9 @@ void lock_request_unit_test::test_wait_time_callback(void) { ...@@ -134,6 +134,9 @@ void lock_request_unit_test::test_wait_time_callback(void) {
release_lock_and_retry_requests(&lt, txnid_a, one, one); release_lock_and_retry_requests(&lt, txnid_a, one, one);
request_a.destroy(); request_a.destroy();
lt.release_reference();
lt.destroy();
} }
} /* namespace toku */ } /* namespace toku */
......
...@@ -165,6 +165,9 @@ void locktree_unit_test::test_conflicts(void) { ...@@ -165,6 +165,9 @@ void locktree_unit_test::test_conflicts(void) {
lt.remove_overlapping_locks_for_txnid(txnid_a, three, four); lt.remove_overlapping_locks_for_txnid(txnid_a, three, four);
invariant(no_row_locks(&lt)); invariant(no_row_locks(&lt));
} }
lt.release_reference();
lt.destroy();
} }
} /* namespace toku */ } /* namespace toku */
......
...@@ -112,6 +112,9 @@ void locktree_unit_test::test_create_destroy(void) { ...@@ -112,6 +112,9 @@ void locktree_unit_test::test_create_destroy(void) {
invariant(info->pending_lock_requests.size() == 0); invariant(info->pending_lock_requests.size() == 0);
invariant(lt.m_sto_end_early_count == 0); invariant(lt.m_sto_end_early_count == 0);
invariant(lt.m_sto_end_early_time == 0); invariant(lt.m_sto_end_early_time == 0);
lt.release_reference();
lt.destroy();
} }
} /* namespace toku */ } /* namespace toku */
......
...@@ -162,6 +162,9 @@ void locktree_unit_test::test_infinity(void) { ...@@ -162,6 +162,9 @@ void locktree_unit_test::test_infinity(void) {
invariant(r == DB_LOCK_NOTGRANTED); invariant(r == DB_LOCK_NOTGRANTED);
lt.remove_overlapping_locks_for_txnid(txnid_a, toku_dbt_negative_infinity(), toku_dbt_positive_infinity()); lt.remove_overlapping_locks_for_txnid(txnid_a, toku_dbt_negative_infinity(), toku_dbt_positive_infinity());
lt.release_reference();
lt.destroy();
} }
} /* namespace toku */ } /* namespace toku */
......
...@@ -134,6 +134,9 @@ void locktree_unit_test::test_misc(void) { ...@@ -134,6 +134,9 @@ void locktree_unit_test::test_misc(void) {
expected_descriptor = &d2; expected_descriptor = &d2;
r = lt.m_cmp->compare(&dbt_a, &dbt_b); r = lt.m_cmp->compare(&dbt_a, &dbt_b);
invariant(r == expected_comparison_magic); invariant(r == expected_comparison_magic);
lt.release_reference();
lt.destroy();
} }
} /* namespace toku */ } /* namespace toku */
......
...@@ -203,6 +203,9 @@ void locktree_unit_test::test_overlapping_relock(void) { ...@@ -203,6 +203,9 @@ void locktree_unit_test::test_overlapping_relock(void) {
// remove the other txnid's lock now // remove the other txnid's lock now
lt.remove_overlapping_locks_for_txnid(the_other_txnid, hundred, hundred); lt.remove_overlapping_locks_for_txnid(the_other_txnid, hundred, hundred);
lt.release_reference();
lt.destroy();
} }
} /* namespace toku */ } /* namespace toku */
......
...@@ -169,6 +169,9 @@ void locktree_unit_test::test_single_txnid_optimization(void) { ...@@ -169,6 +169,9 @@ void locktree_unit_test::test_single_txnid_optimization(void) {
buffer.destroy(); buffer.destroy();
} }
lt.release_reference();
lt.destroy();
} }
} /* namespace toku */ } /* 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