[API addition] AbstractMediaStream::setAutoDelete

Matthias Kretz kretz at kde.org
Mon Aug 27 12:03:28 BST 2007


On Monday 27 August 2007, Bradley T Hughes wrote:
> On Monday 27 August 2007 11:59:31 Matthias Kretz wrote:
> > Hi,
> >
> > I'd like to add two methods to Phonon::AbstractMediaStream to allow for
> > easier memory management. Basically so far the ownership of the stream
> > stayed with the application, but I want to give the application the
> > possibility to pass ownership to Phonon.
> >
> > Rationale: The application cannot know the exact point in the application
> > where the stream is not used anymore. And most of the time it's a
> > "create, set and forget about it" operation anyway. I even need the
> > autoDelete property internally for the KIO stream.
>
> If the app cannot know when to delete something, then why not have
> ownership completely in Phonon instead?

a) I find it unintuitive if ownership is passed to Phonon (that's subjective, 
of course)
b) The object might be tied to some parts of the application and auto-deleting 
it could be a problem there (so it would need at least the 
setAutoDelete(false) possibility - which keeping a MediaSource object 
wrapping the stream would also achieve)
c) If you want to reuse the stream object you don't want it to get deleted 
automatically (again this could also be solved by keeping a MediaSource 
object wrapping the stream)

So, yes, it could be done to pass ownership by default. It's just my feeling 
that the default should be to not pass ownership.

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070827/aacab69b/attachment.sig>


More information about the kde-core-devel mailing list