fix mutex_trylock bug
[c11tester.git] / waitobj.cc
index 0d1853c825ba91ba6270cce8d11d9d99dd995847..dc422be7804e0a245130b1ff0b3a93c511931e75 100644 (file)
@@ -168,6 +168,8 @@ void WaitObj::clear_waiting_for()
                target_nodes->reset();
        }
 
                target_nodes->reset();
        }
 
+       delete iter;
+
        waiting_for.reset();
        /* waited_by relation should be kept */
 }
        waiting_for.reset();
        /* waited_by relation should be kept */
 }
@@ -185,6 +187,7 @@ void WaitObj::print_waiting_for(bool verbose)
                model_print("%d ", waiting_for_id);
        }
        model_print("\n");
                model_print("%d ", waiting_for_id);
        }
        model_print("\n");
+       delete it;
 
        if (verbose) {
                /* Print out the distances from each thread to target nodes */
 
        if (verbose) {
                /* Print out the distances from each thread to target nodes */
@@ -204,6 +207,8 @@ void WaitObj::print_waiting_for(bool verbose)
                                }
                                model_print(") ");
                        }
                                }
                                model_print(") ");
                        }
+
+                       delete node_iter;
                }
                model_print("\n");
        }
                }
                model_print("\n");
        }
@@ -222,4 +227,6 @@ void WaitObj::print_waited_by()
                model_print("%d ", thread_id);
        }
        model_print("\n");
                model_print("%d ", thread_id);
        }
        model_print("\n");
+
+       delete it;
 }
 }