QEglFSKmsGbmScreen::framebufferForBufferObject: release() at the correct time
It's the gbm_bo_get_user_data() function that takes ownership of the
FrameBuffer object, not the caller of the function, so release() into
gbm_bo_set_user_data() not into the return. This threw Coverity off,
which complained about a leak of the return value in the caller.
Amends 2f0fa59d59, but not picking
through all the refactorings the code has since seen.
Pick-to: 6.7 6.6 6.5
Coverity-Id: 444117
Change-Id: I5f058e4a42942349193eecfd8c00ec9499ef4886
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
parent
d2436f7294
commit
1cfe42235c
|
|
@ -73,8 +73,9 @@ QEglFSKmsGbmScreen::FrameBuffer *QEglFSKmsGbmScreen::framebufferForBufferObject(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
gbm_bo_set_user_data(bo, fb.get(), bufferDestroyedHandler);
|
||||
return fb.release();
|
||||
auto res = fb.get();
|
||||
gbm_bo_set_user_data(bo, fb.release(), bufferDestroyedHandler);
|
||||
return res;
|
||||
}
|
||||
|
||||
QEglFSKmsGbmScreen::QEglFSKmsGbmScreen(QEglFSKmsDevice *device, const QKmsOutput &output, bool headless)
|
||||
|
|
|
|||
Loading…
Reference in New Issue