diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc index aeb1f15ffc..da6d2d0bfa 100644 --- a/libs/ardour/source_factory.cc +++ b/libs/ardour/source_factory.cc @@ -167,7 +167,7 @@ SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks) boost::shared_ptr ap (new AudioPlaylistSource (s, node)); if (setup_peakfile (ap, true)) { - return boost::shared_ptr(); + throw failed_constructor (); } ap->check_for_analysis_data_on_disk (); @@ -186,7 +186,7 @@ SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks) boost::shared_ptr ret (src); BOOST_MARK_SOURCE (ret); if (setup_peakfile (ret, defer_peaks)) { - return boost::shared_ptr(); + throw failed_constructor (); } ret->check_for_analysis_data_on_disk (); SourceCreated (ret); @@ -200,7 +200,7 @@ SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks) BOOST_MARK_SOURCE (ret); if (setup_peakfile (ret, defer_peaks)) { - return boost::shared_ptr(); + throw failed_constructor (); } ret->check_for_analysis_data_on_disk (); @@ -225,7 +225,7 @@ SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks) } } - return boost::shared_ptr(); + throw failed_constructor (); } boost::shared_ptr @@ -239,7 +239,7 @@ SourceFactory::createExternal (DataType type, Session& s, const string& path, boost::shared_ptr ret (src); BOOST_MARK_SOURCE (ret); if (setup_peakfile (ret, defer_peaks)) { - return boost::shared_ptr(); + throw failed_constructor (); } ret->check_for_analysis_data_on_disk (); if (announce) { @@ -254,7 +254,7 @@ SourceFactory::createExternal (DataType type, Session& s, const string& path, boost::shared_ptr ret (src); BOOST_MARK_SOURCE (ret); if (setup_peakfile (ret, defer_peaks)) { - return boost::shared_ptr(); + throw failed_constructor (); } ret->check_for_analysis_data_on_disk (); if (announce) { @@ -301,7 +301,7 @@ SourceFactory::createExternal (DataType type, Session& s, const string& path, } - return boost::shared_ptr(); + throw failed_constructor (); } boost::shared_ptr @@ -320,7 +320,7 @@ SourceFactory::createWritable (DataType type, Session& s, const std::string& pat BOOST_MARK_SOURCE (ret); if (setup_peakfile (ret, defer_peaks)) { - return boost::shared_ptr(); + throw failed_constructor (); } // no analysis data - this is a new file @@ -353,7 +353,7 @@ SourceFactory::createWritable (DataType type, Session& s, const std::string& pat } } - return boost::shared_ptr (); + throw failed_constructor (); } boost::shared_ptr @@ -368,7 +368,7 @@ SourceFactory::createForRecovery (DataType type, Session& s, const std::string& BOOST_MARK_SOURCE (ret); if (setup_peakfile (ret, false)) { - return boost::shared_ptr(); + throw failed_constructor (); } // no analysis data - this is still basically a new file (we @@ -384,7 +384,7 @@ SourceFactory::createForRecovery (DataType type, Session& s, const std::string& error << _("Recovery attempted on a MIDI file - not implemented") << endmsg; } - return boost::shared_ptr (); + throw failed_constructor (); } boost::shared_ptr @@ -407,7 +407,7 @@ SourceFactory::createFromPlaylist (DataType type, Session& s, boost::shared_ptr< boost::shared_ptr ret (src); if (setup_peakfile (ret, defer_peaks)) { - return boost::shared_ptr(); + throw failed_constructor (); } ret->check_for_analysis_data_on_disk (); @@ -447,5 +447,5 @@ SourceFactory::createFromPlaylist (DataType type, Session& s, boost::shared_ptr< } - return boost::shared_ptr(); + throw failed_constructor (); }