everything seems to work

This commit is contained in:
Pagwin 2026-01-16 16:10:41 -05:00
parent deca24be12
commit 5ff4a900f5
No known key found for this signature in database
GPG key ID: 81137023740CA260
2 changed files with 7 additions and 4 deletions

View file

@ -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:

View file

@ -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);