summaryrefslogtreecommitdiff
path: root/libs/ardour/graph.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-04-24 14:41:07 +0200
committerRobin Gareus <robin@gareus.org>2016-04-24 14:43:18 +0200
commite3607a4c8bbe68714600cb3849abee0c20d0047c (patch)
tree8c93a2eb519ddd6ed33e1f6b51e42bebcab5f3cf /libs/ardour/graph.cc
parentc4c6c38dbde32fa9478977740864f5c141dff092 (diff)
plug some memory leaks in libardour
Diffstat (limited to 'libs/ardour/graph.cc')
-rw-r--r--libs/ardour/graph.cc51
1 files changed, 26 insertions, 25 deletions
diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc
index ff4f860d68..3cf0eaea16 100644
--- a/libs/ardour/graph.cc
+++ b/libs/ardour/graph.cc
@@ -412,15 +412,16 @@ Graph::helper_thread()
ProcessThread* pt = new ProcessThread ();
resume_rt_malloc_checks ();
- pt->get_buffers();
+ pt->get_buffers();
- while(1) {
- if (run_one()) {
- break;
- }
- }
+ while(1) {
+ if (run_one()) {
+ break;
+ }
+ }
- pt->drop_buffers();
+ pt->drop_buffers();
+ delete pt;
}
/** Here's the main graph thread */
@@ -431,35 +432,35 @@ Graph::main_thread()
ProcessThread* pt = new ProcessThread ();
resume_rt_malloc_checks ();
- pt->get_buffers();
+ pt->get_buffers();
- again:
- _callback_start_sem.wait ();
+again:
+ _callback_start_sem.wait ();
DEBUG_TRACE(DEBUG::ProcessThreads, "main thread is awake\n");
- if (!_threads_active) {
- return;
- }
+ if (!_threads_active) {
+ return;
+ }
prep ();
- if (_graph_empty && _threads_active) {
- _callback_done_sem.signal ();
- DEBUG_TRACE(DEBUG::ProcessThreads, "main thread sees graph done, goes back to sleep\n");
- goto again;
- }
+ if (_graph_empty && _threads_active) {
+ _callback_done_sem.signal ();
+ DEBUG_TRACE(DEBUG::ProcessThreads, "main thread sees graph done, goes back to sleep\n");
+ goto again;
+ }
/* This loop will run forever */
- while (1) {
+ while (1) {
DEBUG_TRACE(DEBUG::ProcessThreads, "main thread runs one graph node\n");
- if (run_one()) {
- break;
- }
- }
+ if (run_one()) {
+ break;
+ }
+ }
- pt->drop_buffers();
- delete (pt);
+ pt->drop_buffers();
+ delete (pt);
}
void