projects
/
ardour.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c4c6c38
)
plug some memory leaks in libardour
author
Robin Gareus
<robin@gareus.org>
Sun, 24 Apr 2016 12:41:07 +0000
(14:41 +0200)
committer
Robin Gareus
<robin@gareus.org>
Sun, 24 Apr 2016 12:43:18 +0000
(14:43 +0200)
libs/ardour/audioengine.cc
patch
|
blob
|
history
libs/ardour/auditioner.cc
patch
|
blob
|
history
libs/ardour/graph.cc
patch
|
blob
|
history
libs/ardour/lv2_plugin.cc
patch
|
blob
|
history
libs/ardour/processor.cc
patch
|
blob
|
history
libs/ardour/session.cc
patch
|
blob
|
history
libs/ardour/session_state.cc
patch
|
blob
|
history
tools/luadevel/luasession.cc
patch
|
blob
|
history
diff --git
a/libs/ardour/audioengine.cc
b/libs/ardour/audioengine.cc
index 07a70aebc9674a171de42a63bd6ef6c8789c15ee..a3ecd04b47ae2be3d2244cbde8793bf1f812b0de 100644
(file)
--- a/
libs/ardour/audioengine.cc
+++ b/
libs/ardour/audioengine.cc
@@
-114,6
+114,7
@@
AudioEngine::~AudioEngine ()
for (BackendMap::const_iterator i = _backends.begin(); i != _backends.end(); ++i) {
i->second->deinstantiate();
}
for (BackendMap::const_iterator i = _backends.begin(); i != _backends.end(); ++i) {
i->second->deinstantiate();
}
+ delete _main_thread;
}
AudioEngine*
}
AudioEngine*
@@
-1234,6
+1235,7
@@
AudioEngine::thread_init_callback (void* arg)
AsyncMIDIPort::set_process_thread (pthread_self());
if (arg) {
AsyncMIDIPort::set_process_thread (pthread_self());
if (arg) {
+ delete AudioEngine::instance()->_main_thread;
/* the special thread created/managed by the backend */
AudioEngine::instance()->_main_thread = new ProcessThread;
}
/* the special thread created/managed by the backend */
AudioEngine::instance()->_main_thread = new ProcessThread;
}
diff --git
a/libs/ardour/auditioner.cc
b/libs/ardour/auditioner.cc
index fe84a2d717b884bda0d980152fd9eaf20ef1597f..33f74faf8037eb557a015f9b5a0feaf85b41ea65 100644
(file)
--- a/
libs/ardour/auditioner.cc
+++ b/
libs/ardour/auditioner.cc
@@
-85,13
+85,17
@@
Auditioner::init ()
Auditioner::~Auditioner ()
{
Auditioner::~Auditioner ()
{
+ if (asynth) {
+ asynth->drop_references ();
+ }
+ asynth.reset ();
}
void
Auditioner::lookup_synth ()
{
string plugin_id = Config->get_midi_audition_synth_uri();
}
void
Auditioner::lookup_synth ()
{
string plugin_id = Config->get_midi_audition_synth_uri();
- asynth
= boost::shared_ptr<Processor>
();
+ asynth
.reset
();
if (!plugin_id.empty()) {
boost::shared_ptr<Plugin> p;
p = find_plugin (_session, plugin_id, ARDOUR::LV2);
if (!plugin_id.empty()) {
boost::shared_ptr<Plugin> p;
p = find_plugin (_session, plugin_id, ARDOUR::LV2);
diff --git
a/libs/ardour/graph.cc
b/libs/ardour/graph.cc
index ff4f860d683b1103eb9613495a4243d25a0cdabc..3cf0eaea1602e6c6b8ad669eeddf1269a7ef098b 100644
(file)
--- 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 ();
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 */
}
/** Here's the main graph thread */
@@
-431,35
+432,35
@@
Graph::main_thread()
ProcessThread* pt = new ProcessThread ();
resume_rt_malloc_checks ();
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");
DEBUG_TRACE(DEBUG::ProcessThreads, "main thread is awake\n");
-
if (!_threads_active) {
-
return;
-
}
+ if (!_threads_active) {
+ return;
+ }
prep ();
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 */
/* This loop will run forever */
-
while (1) {
+ while (1) {
DEBUG_TRACE(DEBUG::ProcessThreads, "main thread runs one graph node\n");
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
}
void
diff --git
a/libs/ardour/lv2_plugin.cc
b/libs/ardour/lv2_plugin.cc
index 5194ae6166e064bd8762e226a4a4261349024614..6a5ed97aaebfa5a6860f80bd0396247a4f8d2139 100644
(file)
--- a/
libs/ardour/lv2_plugin.cc
+++ b/
libs/ardour/lv2_plugin.cc
@@
-808,6
+808,7
@@
LV2Plugin::~LV2Plugin ()
#endif
free(_features);
#endif
free(_features);
+ free(_log_feature.data);
free(_make_path_feature.data);
free(_work_schedule_feature.data);
free(_make_path_feature.data);
free(_work_schedule_feature.data);
@@
-828,6
+829,7
@@
LV2Plugin::~LV2Plugin ()
delete [] _shadow_data;
delete [] _defaults;
delete [] _ev_buffers;
delete [] _shadow_data;
delete [] _defaults;
delete [] _ev_buffers;
+ delete _impl;
}
bool
}
bool
diff --git
a/libs/ardour/processor.cc
b/libs/ardour/processor.cc
index e55d31ce52fa9d3270b6ac1ea08a6e974b34a364..d3ffe152cb7d24534cf2c742fcac553c5a86a221 100644
(file)
--- a/
libs/ardour/processor.cc
+++ b/
libs/ardour/processor.cc
@@
-126,6
+126,8
@@
Processor::state (bool full_state)
XMLNode& automation = Automatable::get_automation_xml_state();
if (!automation.children().empty() || !automation.properties().empty()) {
node->add_child_nocopy (automation);
XMLNode& automation = Automatable::get_automation_xml_state();
if (!automation.children().empty() || !automation.properties().empty()) {
node->add_child_nocopy (automation);
+ } else {
+ delete &automation;
}
}
}
}
diff --git
a/libs/ardour/session.cc
b/libs/ardour/session.cc
index efc1665219c274b685ce51ec050112975bf07b08..e9d85300b7da180492cd87644894810f4f128a9d 100644
(file)
--- a/
libs/ardour/session.cc
+++ b/
libs/ardour/session.cc
@@
-101,6
+101,7
@@
#include "ardour/source_factory.h"
#include "ardour/speakers.h"
#include "ardour/tempo.h"
#include "ardour/source_factory.h"
#include "ardour/speakers.h"
#include "ardour/tempo.h"
+#include "ardour/ticker.h"
#include "ardour/track.h"
#include "ardour/user_bundle.h"
#include "ardour/utils.h"
#include "ardour/track.h"
#include "ardour/user_bundle.h"
#include "ardour/utils.h"
@@
-306,6
+307,7
@@
Session::Session (AudioEngine &eng,
, _speakers (new Speakers)
, _order_hint (-1)
, ignore_route_processor_changes (false)
, _speakers (new Speakers)
, _order_hint (-1)
, ignore_route_processor_changes (false)
+ , midi_clock (0)
, _scene_changer (0)
, _midi_ports (0)
, _mmc (0)
, _scene_changer (0)
, _midi_ports (0)
, _mmc (0)
@@
-739,6
+741,7
@@
Session::destroy ()
delete _midi_ports; _midi_ports = 0;
delete _locations; _locations = 0;
delete _midi_ports; _midi_ports = 0;
delete _locations; _locations = 0;
+ delete midi_clock;
delete _tempo_map;
DEBUG_TRACE (DEBUG::Destruction, "Session::destroy() done\n");
delete _tempo_map;
DEBUG_TRACE (DEBUG::Destruction, "Session::destroy() done\n");
diff --git
a/libs/ardour/session_state.cc
b/libs/ardour/session_state.cc
index 95eb36c07f4ec6fb617d12f20b214a8fac01f438..d495d0b701ca61d8d0012d29b177796d1418046a 100644
(file)
--- a/
libs/ardour/session_state.cc
+++ b/
libs/ardour/session_state.cc
@@
-251,6
+251,7
@@
Session::post_engine_init ()
/* MidiClock requires a tempo map */
/* MidiClock requires a tempo map */
+ delete midi_clock;
midi_clock = new MidiClockTicker ();
midi_clock->set_session (this);
midi_clock = new MidiClockTicker ();
midi_clock->set_session (this);
diff --git
a/tools/luadevel/luasession.cc
b/tools/luadevel/luasession.cc
index 1e98728ce63fd68341149df417fd65e6d1d9876d..5f406f9c9d91cfa625392e9b5b134282f87200bb 100644
(file)
--- a/
tools/luadevel/luasession.cc
+++ b/
tools/luadevel/luasession.cc
@@
-395,6
+395,7
@@
int main (int argc, char **argv)
event_loop->run();
free (line);
}
event_loop->run();
free (line);
}
+ free (line);
printf ("\n");
if (_session) {
printf ("\n");
if (_session) {