fix: fix broken in wayland

修复在wayland下修复光标崩溃的问题
释放对应的指针时应使用特定的函数

Log: 修复wayland下崩溃问题
Influence: wayland下调整任务栏高度
Task: https://pms.uniontech.com/zentao/task-view-98205.html

Change-Id: I29cd23d78cc4973983b3db0e44c0671d4460a2d5
This commit is contained in:
test1 2022-01-17 20:55:31 +08:00 committed by fanpengcheng
parent 4aa44632af
commit 7b20448427
2 changed files with 2 additions and 2 deletions

View File

@ -94,6 +94,6 @@ void AppDrag::setDragMoveCursor()
QImage img((const uchar*)images->images[0]->pixels, imgW, imgH, QImage::Format_ARGB32);
QPixmap pixmap = QPixmap::fromImage(img);
delete images;
XcursorImagesDestroy(images);
setDragCursor(pixmap, Qt::MoveAction);
}

View File

@ -78,6 +78,6 @@ QCursor* ImageUtil::loadQCursorFromX11Cursor(const char* theme, const char* curs
QImage img((const uchar*)images->images[0]->pixels, imgW, imgH, QImage::Format_ARGB32);
QPixmap pixmap = QPixmap::fromImage(img);
QCursor *cursor = new QCursor(pixmap, images->images[0]->xhot, images->images[0]->yhot);
delete images;
XcursorImagesDestroy(images);
return cursor;
}