Revision f9ea65e...

Go back to digest for 30th October 2011

Bug Fixes in Multimedia

Matěj Laitl committed changes in [amarok] /core-impl/collections:

Mandatory QObject-based memory mngment for all MediaDevice Capabilities

AFAICS, all subclasses of Handler::Capability were only created using
"new" and never deleted, yielding continuous memory leaks. Make it
compulsory for them to pass their parent object (relevant
MediaDeviceHandler) so that they are deleted when their associated
collections (and therefore handlers) disappear.

Added benefit is that it is now guaranteed inside capabilities that
their collection (handler) is valid throughout their lifetime.

All external code that keeps references to such capabilities should do
so only using QWeakPointer (all found places fixed).

Apart from fixing memory leaks, this should definitely fix crash in
bug 245852. Fix also MediaDeviceTrack::inCollection() so that other
crashed are avoided.


FIXED-IN: 2.5

File Changes

Modified 16 files
  • /core-impl/collections
  •   src/mediadevicecollection/MediaDeviceMeta.cpp
  •   src/mediadevicecollection/MediaDeviceMeta.h
  •   src/mediadevicecollection/handler/MediaDeviceHandlerCapability.h
  •   src/ipodcollection/handler/capabilities/IpodArtworkCapability.cpp
  •   src/ipodcollection/handler/capabilities/IpodPlaylistCapability.cpp
  •   src/ipodcollection/handler/capabilities/IpodReadCapability.cpp
  •   src/ipodcollection/handler/capabilities/IpodWriteCapability.cpp
  •   src/mediadevicecollection/handler/capabilities/ArtworkCapability.h
  •   src/mediadevicecollection/handler/capabilities/PlaylistCapability.h
  •   src/mediadevicecollection/handler/capabilities/ReadCapability.h
  •   src/mediadevicecollection/handler/capabilities/ReadCapabilityBase.h
  •   src/mediadevicecollection/handler/capabilities/WriteCapability.h
  •   src/mediadevicecollection/handler/capabilities/WriteCapabilityBase.h
  •   src/mtpcollection/handler/capabilities/MtpPlaylistCapability.cpp
  •   src/mtpcollection/handler/capabilities/MtpReadCapability.cpp
  •   src/mtpcollection/handler/capabilities/MtpWriteCapability.cpp
16 files changed in total