diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-01-04 05:13:35 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-01-07 22:29:23 +0200 |
commit | 451ffd1fcd4e1287c3a600e83e61028aab74be59 (patch) | |
tree | a85109c5e35dba54c3efac3c9bdfa9af0b77b725 /src/libcamera/bound_method.cpp | |
parent | a915a65fab5b202b51fadf585797384adb7f6b0c (diff) |
libcamera: bound_method: Fix memory leak with direct connections
When BoundMethodBase::activatePack() is called with the connection type
set to ConnectionTypeDirect, the method isn't deleted even if
deleteMethod is true, as is the case when called from
Object::invokeMethod(). This causes a memory leak. Fix it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/bound_method.cpp')
-rw-r--r-- | src/libcamera/bound_method.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libcamera/bound_method.cpp b/src/libcamera/bound_method.cpp index 4c0cd415..45c76577 100644 --- a/src/libcamera/bound_method.cpp +++ b/src/libcamera/bound_method.cpp @@ -62,6 +62,8 @@ void BoundMethodBase::activatePack(void *pack, bool deleteMethod) case ConnectionTypeDirect: default: invokePack(pack); + if (deleteMethod) + delete this; break; case ConnectionTypeQueued: { |