Debug region/source removal

This commit is contained in:
Robin Gareus 2023-05-30 18:19:48 +02:00
parent 4bc8a3e9c7
commit 331efe835f
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 24 additions and 1 deletions

View File

@ -426,7 +426,7 @@ protected:
void ripple_locked (timepos_t const & at, timecnt_t const & distance, RegionList *exclude);
void ripple_unlocked (timepos_t const & at, timecnt_t const & distance, RegionList *exclude, ThawList& thawlist, bool notify = true);
virtual void region_going_away (std::weak_ptr<Region> /*region*/) {}
virtual void region_going_away (std::weak_ptr<Region> /*region*/);
virtual XMLNode& state (bool) const;

View File

@ -662,6 +662,29 @@ Playlist::clear_pending ()
pending_layering = false;
}
void
Playlist::region_going_away (std::weak_ptr<Region> region)
{
if (_session.deletion_in_progress ()) {
return;
}
/* Before a region can be destroyed it must already
* be removed from all playlists.
*/
#ifndef NDEBUG
std::shared_ptr<Region> r = region.lock();
if (!r) {
return;
}
assert (find_region (r->id ()));
{
RegionReadLock rlock (this);
assert (all_regions.find (r) != all_regions.end());
}
#endif
//remove_region (r);
}
/*************************************************************
* PLAYLIST OPERATIONS
*************************************************************/