From f8ffcc027f3c54dbb755b7fb0dc53ec21c7fd600 Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <randrianasulu@gmail.com>
Date: Sun, 13 Nov 2022 17:49:11 +0300
Subject: [PATCH 1/2] EXPERIMENTAL better fix for nested edl load/undo?

---
 cinelerra-5.1/cinelerra/cache.C | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/cinelerra-5.1/cinelerra/cache.C b/cinelerra-5.1/cinelerra/cache.C
index a93f1e1b..7c640d9e 100644
--- a/cinelerra-5.1/cinelerra/cache.C
+++ b/cinelerra-5.1/cinelerra/cache.C
@@ -117,11 +117,14 @@ File* CICache::check_out(Asset *asset, EDL *edl, int block)
 
 // cache deleted during checkout, destroy this
 	if( users == 1 ) {
-		remove_user();
+		current->Garbage::remove_user();
+		total_lock->unlock();
 		return 0;
 	}
 
-	remove_user();
+	//printf("users: %i \n", users );
+	
+	current->Garbage::remove_user();
 	total_lock->unlock();
 //printf("check out %p %lx %s\n", current, tid, asset->path);
 	return current ? current->file : 0;
-- 
2.30.4

