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>
This commit is contained in:
Laurent Pinchart
2020-01-04 05:13:35 +02:00
parent a915a65fab
commit 451ffd1fcd

View File

@@ -62,6 +62,8 @@ void BoundMethodBase::activatePack(void *pack, bool deleteMethod)
case ConnectionTypeDirect:
default:
invokePack(pack);
if (deleteMethod)
delete this;
break;
case ConnectionTypeQueued: {