Partially fixed a bug in the test suite that led to test runs randomly failing.
[invirt/third/libt4.git] / handle.cc
index 3b6e1fa..d32c895 100644 (file)
--- a/handle.cc
+++ b/handle.cc
@@ -62,10 +62,11 @@ hinfo * handle_mgr::acquire_handle(string m) {
     if (hmap.find(m) == hmap.end()) {
         h = new hinfo(m);
         hmap[m] = h;
+        h->refcnt++;
     } else if (!hmap[m]->del) {
         h = hmap[m];
+        h->refcnt++;
     }
-    h->refcnt++;
     return h;
 }