mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
fix: 资源未释放
多次快速旋转屏幕会多次调用这里,之前的资源未释放会导致后面的连接不成功,读不到正确的屏幕信息。 Log: 修复屏幕参数获取错误的问题。 Change-Id: I4bb1961a0e4786de1272a3897578be9c97cfa3cb
This commit is contained in:
parent
dd54b212f3
commit
81053b31c9
@ -1747,6 +1747,12 @@ void MultiScreenWorker::updateScreenSize()
|
||||
int screenNum;
|
||||
xcb_connection_t *connection = xcb_connect(NULL, &screenNum);
|
||||
|
||||
/* Check for failure */
|
||||
if (xcb_connection_has_error(connection)) {
|
||||
xcb_disconnect(connection);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get the screen whose number is screenNum */
|
||||
const xcb_setup_t *setup = xcb_get_setup(connection);
|
||||
xcb_screen_iterator_t iter = xcb_setup_roots_iterator(setup);
|
||||
@ -1760,6 +1766,8 @@ void MultiScreenWorker::updateScreenSize()
|
||||
|
||||
m_screenRawWidth = screen->width_in_pixels;
|
||||
m_screenRawHeight = screen->height_in_pixels;
|
||||
|
||||
xcb_disconnect(connection);
|
||||
}
|
||||
|
||||
void MultiScreenWorker::onTouchPress(int type, int x, int y, const QString &key)
|
||||
|
Loading…
x
Reference in New Issue
Block a user