<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вт, 24 янв. 2023 г., 02:44 Stefan de Konink <<a href="mailto:stefan@konink.de" target="_blank" rel="noreferrer">stefan@konink.de</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Andrew,<br>
<br>
When changing this, to be more in line with the "HV" code...<br>
<br>
diff --git a/cinelerra-5.1/cinelerra/playbackengine.C <br>
b/cinelerra-5.1/cinelerra/playbackengine.C<br>
index 815e506f..3c2a9368 100644<br>
--- a/cinelerra-5.1/cinelerra/playbackengine.C<br>
+++ b/cinelerra-5.1/cinelerra/playbackengine.C<br>
@@ -172,9 +172,9 @@ void PlaybackEngine::create_cache()<br>
{<br>
cache_lock->lock("PlaybackEngine::create_cache");<br>
if( audio_cache )<br>
- audio_cache->remove_user();<br>
+ delete audio_cache;<br>
if( video_cache )<br>
- video_cache->remove_user();<br>
+ delete video_cache;<br>
audio_cache = new CICache(preferences);<br>
video_cache = new CICache(preferences);<br>
cache_lock->unlock();<br>
<br>
<br>
...will result in a fix for the memory leak, but does cause a warning <br>
message.<br>
<br>
Garbage::~Garbage: title=CICache users=1 was not deleted by <br>
Garbage::remove_user<br>
<br>
<br>
This was changed with f5725c7e (7/4/20). </blockquote></div></div><div dir="auto"><br></div><div dir="auto"><a href="https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blobdiff;f=cinelerra-5.1/cinelerra/playbackengine.C;h=82bd7bb6587b930b77caa7f4da7673255539b3a3;hp=8ce98234c3ffc7ed2b0ed6e4c00b4f6e3fa749ee;hb=f5725c7e12def18fec49a295dad688652edaa4b3;hpb=c387b8938dc838e5b92d1cd735975d0928ecf61a" target="_blank" rel="noreferrer">https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blobdiff;f=cinelerra-5.1/cinelerra/playbackengine.C;h=82bd7bb6587b930b77caa7f4da7673255539b3a3;hp=8ce98234c3ffc7ed2b0ed6e4c00b4f6e3fa749ee;hb=f5725c7e12def18fec49a295dad688652edaa4b3;hpb=c387b8938dc838e5b92d1cd735975d0928ecf61a</a><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">hm ....</div><div dir="auto"><br></div><div dir="auto">may be you also can try to restore this idea about calling new only if cache does not exist ...</div><div dir="auto"><br></div><div dir="auto"><div dir="auto">@@ -162,10 +164,12 @@ void PlaybackEngine::wait_render_engine()</div><div dir="auto"> </div><div dir="auto"> void PlaybackEngine::create_cache()</div><div dir="auto"> {</div><div dir="auto">- if(audio_cache) { delete audio_cache; audio_cache = 0; }</div><div dir="auto">- if(video_cache) { delete video_cache; video_cache = 0; }</div><div dir="auto">- if(!audio_cache) audio_cache = new CICache(preferences);</div><div dir="auto">- if(!video_cache) video_cache = new CICache(preferences);</div><div dir="auto">+ if( audio_cache )</div><div dir="auto">+ audio_cache->remove_user();</div><div dir="auto">+ if( video_cache )</div><div dir="auto">+ video_cache->remove_user();</div><div dir="auto">+ audio_cache = new CICache(preferences);</div><div dir="auto">+ video_cache = new CICache(preferences);</div><div dir="auto"> }</div><div dir="auto"> </div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">But also shows that many unrelated <br>
changes cause real issues to hide. I found this by hand, not even using git <br>
bisect. I understand the urge for the garbage collector, but for some <br>
reason not behaving. What I notice is that the 'last' object is empty when <br>
it is actually destroyed by the garbage collector (~CICache). What is the <br>
best way going forward? <br>
<br>
--<br>
Stefan<br>
</blockquote></div></div></div>