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:
@@ -62,6 +62,8 @@ void BoundMethodBase::activatePack(void *pack, bool deleteMethod)
|
||||
case ConnectionTypeDirect:
|
||||
default:
|
||||
invokePack(pack);
|
||||
if (deleteMethod)
|
||||
delete this;
|
||||
break;
|
||||
|
||||
case ConnectionTypeQueued: {
|
||||
|
||||
Reference in New Issue
Block a user