-----Original Message----- From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Mark Thompson Sent: Monday, May 2, 2022 12:01 AM To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH 1/3] avutils/hwcontext: add derive- device function which searches for existing devices in both directions
[..]
* Whenever you use derivation it creates a circular reference, so the instances can never be freed in the current implementation.
It's been a while...I thought there wasn't, but looking at it now, it seems you are right.
How would you solve it?
Hmm. You do need both the source and derived device to be able to keep the other alive with this form, so the strict reference-counting structure isn't going to work. Given that, I guess it's got to do something else but I've no idea what.
Ok, before I come up with something that might find objection, I'd like to ask all around: Do we have some pattern for weak/shared referencing via AVBufferRef? Thanks softworkz