mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-14 18:46:34 +01:00
Use a weak_ptr rather than a bald pointer for _midi_source in MidiModel.
git-svn-id: svn://localhost/ardour2/branches/3.0@8228 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
ebf3762fa9
commit
7d4e03e28e
5 changed files with 76 additions and 43 deletions
|
|
@ -69,8 +69,6 @@ SMFSource::SMFSource (Session& s, const string& path, Source::Flag flags)
|
|||
if (create(path)) {
|
||||
throw failed_constructor ();
|
||||
}
|
||||
|
||||
load_model(true, true); // FIXME
|
||||
}
|
||||
|
||||
/** Constructor used for existing internal-to-session files. */
|
||||
|
|
@ -94,8 +92,6 @@ SMFSource::SMFSource (Session& s, const XMLNode& node, bool must_exist)
|
|||
if (open(_path)) {
|
||||
throw failed_constructor ();
|
||||
}
|
||||
|
||||
load_model(true, true); // FIXME
|
||||
}
|
||||
|
||||
SMFSource::~SMFSource ()
|
||||
|
|
@ -442,8 +438,8 @@ SMFSource::load_model (bool lock, bool force_reload)
|
|||
return;
|
||||
}
|
||||
|
||||
if (! _model) {
|
||||
_model = boost::shared_ptr<MidiModel>(new MidiModel(this));
|
||||
if (!_model) {
|
||||
_model = boost::shared_ptr<MidiModel> (new MidiModel (shared_from_this ()));
|
||||
} else {
|
||||
_model->clear();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue