Skip to content

Commit

Permalink
Fix leak in test_basic.cpp
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Moulard <[email protected]>
  • Loading branch information
Thomas Moulard authored and thomas-moulard committed Apr 8, 2019
1 parent 80b7635 commit 418f95c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/test_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ struct FakeGuarded
* pData = 0;
}

~FakeGuarded()
{
delete pData;
}

int incr_HaveGuard() RCPPUTILS_TSA_REQUIRES(mu)
{
return data++;
Expand Down Expand Up @@ -244,7 +249,6 @@ TEST(test_tsa, ptr_guard) {
int * old = guarded.pData;
guarded.pData = new int; // pData itself is not protected by the mutex
delete old;
delete guarded.pData;
}

TEST(test_tsa, shared_capability) {
Expand Down

0 comments on commit 418f95c

Please sign in to comment.