13
0

Fixed memory leak while recording due to rec region state saved every

time the fake region was updated. Now any StateManager object can 
implement a should_save_state() which controls whether the state of the 
object should be saved.


git-svn-id: svn://localhost/ardour2/trunk@760 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Sampo Savolainen 2006-08-05 17:48:01 +00:00
parent 0eb03e1afe
commit 4a84220fd9
2 changed files with 5 additions and 0 deletions

View File

@ -35,6 +35,8 @@ class StateManager : public sigc::trackable
state_id_t _current_state_id;
virtual bool should_save_state () const { return true; }
static void prohibit_save ();
static void allow_save (const char* why, bool dosave);

View File

@ -72,6 +72,9 @@ StateManager::use_state (state_id_t id)
void
StateManager::save_state (std::string why)
{
if (!should_save_state())
return;
if (!_allow_save) {
SaveAllowed.connect (mem_fun (*this, &StateManager::save_state));
return;