[Spice-devel] [spice-gtk v1 4/6] session: gst_deinit() GStreamer if we initialize it

Victor Toso victortoso at redhat.com
Mon Sep 9 10:05:59 UTC 2019


Hi,

On Mon, Sep 09, 2019 at 05:53:32AM -0400, Frediano Ziglio wrote:
> > > If A initialize Gstreamer and B don't but just check is
> > > initialized then when A call deinit the objects used by B
> > > will contain potential dangling pointers. One right
> > > interface would be simply init/deinit and use a counter to
> > > track the number of initialization.
> > 
> > All channels are related to SpiceSession, that's why I moved
> > it there. Seems reasonable to me at least.
> > 
> 
> Yes, it is. But this won't fix Gstreamer API.
> Nobody forbid users to use spice-gtk library in another program
> to provide for instance multiple VM access using multiple GUI tabs.

Ah, i get what you mean. Indeed, this patch would make a
necessity that Boxes or Virt-manager to call gst_init()
themselves in order to avoid breaking a ongoing Spice session
because the owner of the caller of gst_init() is calling
gst_deinit().

I'll drop this patch and the RFC with unit test as well because
without gst_deinit() there isn't much point on unit testing this
:)

Thanks!

> If the other part will use Gstreamer calling gst_deinit without making
> sure nobody else will use it will potentially lead to memory issues.
> That's my suggestion "don't do it". Calling that from spicy is fine,
> because you know nobody else is using Gstreamer, not in a library.
> 
> > I'll fix proposed changes and send a v2, many thanks for review!
> > 
> >  - toso
> > 
> 
> Frediano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190909/5cc145df/attachment.sig>


More information about the Spice-devel mailing list