Okay. I looked into this a bit more, and it seems like you need to specify 'bool[]' as the template argument for std::unique_ptr, but then it works:

http://en.cppreference.com/w/cpp/memory/unique_ptr

at least the following program doesn't produce any memleaks or other warnings using valgrind:

```c++
#include <memory>

void foo()
{ std::unique_ptr<bool[]> bar(new bool[1000]); }

int main()
{
    for (int i = 0; i < 1000*1000; ++i)
        foo();
    return 0;
}
```