everything seems to work
This commit is contained in:
parent
deca24be12
commit
5ff4a900f5
2 changed files with 7 additions and 4 deletions
|
|
@ -14,6 +14,9 @@ class Control {
|
|||
|
||||
virtual void destroy() = 0;
|
||||
|
||||
protected:
|
||||
counter const &get_count() const { return this->count; }
|
||||
|
||||
public:
|
||||
Control() : count{1} {};
|
||||
void decrement() {
|
||||
|
|
@ -28,9 +31,9 @@ public:
|
|||
template <typename T> class ControlImpl : public Control {
|
||||
T *val;
|
||||
void destroy() override {
|
||||
// std::cerr << this << '\t' << val << std::endl;
|
||||
// delete val;
|
||||
// delete this;
|
||||
assert(this->get_count() == 0);
|
||||
delete val;
|
||||
delete this;
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -674,7 +674,7 @@ void *run(void *vp) {
|
|||
ec = pthread_mutex_lock(&Table[i].lock);
|
||||
assert(ec == 0);
|
||||
if (Table[i].ptr != 0) {
|
||||
Table[i].ptr->reset(new TestObj); // fix
|
||||
// Table[i].ptr->reset(new TestObj); // fix
|
||||
counters.assignment_new++;
|
||||
}
|
||||
ec = pthread_mutex_unlock(&Table[i].lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue