mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-26 12:33:53 +08:00
ui: destroy egl_images in main thread (#30253)
* call eglDestroyImageKHR in ui thread * assert
This commit is contained in:
@@ -187,12 +187,23 @@ void CameraWidget::showEvent(QShowEvent *event) {
|
||||
}
|
||||
|
||||
void CameraWidget::stopVipcThread() {
|
||||
makeCurrent();
|
||||
if (vipc_thread) {
|
||||
vipc_thread->requestInterruption();
|
||||
vipc_thread->quit();
|
||||
vipc_thread->wait();
|
||||
vipc_thread = nullptr;
|
||||
}
|
||||
|
||||
#ifdef QCOM2
|
||||
EGLDisplay egl_display = eglGetCurrentDisplay();
|
||||
assert(egl_display != EGL_NO_DISPLAY);
|
||||
for (auto &pair : egl_images) {
|
||||
eglDestroyImageKHR(egl_display, pair.second);
|
||||
assert(eglGetError() == EGL_SUCCESS);
|
||||
}
|
||||
egl_images.clear();
|
||||
#endif
|
||||
}
|
||||
|
||||
void CameraWidget::availableStreamsUpdated(std::set<VisionStreamType> streams) {
|
||||
@@ -323,8 +334,8 @@ void CameraWidget::vipcConnected(VisionIpcClient *vipc_client) {
|
||||
stream_stride = vipc_client->buffers[0].stride;
|
||||
|
||||
#ifdef QCOM2
|
||||
egl_display = eglGetCurrentDisplay();
|
||||
|
||||
EGLDisplay egl_display = eglGetCurrentDisplay();
|
||||
assert(egl_display != EGL_NO_DISPLAY);
|
||||
for (auto &pair : egl_images) {
|
||||
eglDestroyImageKHR(egl_display, pair.second);
|
||||
}
|
||||
@@ -415,13 +426,6 @@ void CameraWidget::vipcThread() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef QCOM2
|
||||
for (auto &pair : egl_images) {
|
||||
eglDestroyImageKHR(egl_display, pair.second);
|
||||
}
|
||||
egl_images.clear();
|
||||
#endif
|
||||
}
|
||||
|
||||
void CameraWidget::clearFrames() {
|
||||
|
||||
@@ -70,7 +70,6 @@ protected:
|
||||
QColor bg = QColor("#000000");
|
||||
|
||||
#ifdef QCOM2
|
||||
EGLDisplay egl_display;
|
||||
std::map<int, EGLImageKHR> egl_images;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user