mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
cve: 解决代码中的内存泄露
通过sanitize检测项目中存在的内存泄露,并解决 Log: 解决代码中的内存泄露 Change-Id: I6001fec5464c374a60fc7ca642c025fe0df044fc
This commit is contained in:
parent
cefcef3bf6
commit
8ce063e3ab
@ -187,8 +187,6 @@ ThemeAppIcon::~ThemeAppIcon()
|
||||
*/
|
||||
QIcon ThemeAppIcon::getIcon(const QString &name)
|
||||
{
|
||||
QIcon icon;
|
||||
|
||||
QPlatformTheme * const platformTheme = QGuiApplicationPrivate::platformTheme();
|
||||
bool hasUserTheme = QIconLoader::instance()->hasUserTheme();
|
||||
|
||||
@ -196,9 +194,7 @@ QIcon ThemeAppIcon::getIcon(const QString &name)
|
||||
return QIcon::fromTheme(name);
|
||||
|
||||
QIconEngine * const engine = platformTheme->createIconEngine(name);
|
||||
QIcon *cachedIcon = new QIcon(engine);
|
||||
icon = *cachedIcon;
|
||||
return icon;
|
||||
return QIcon(engine);
|
||||
}
|
||||
|
||||
bool ThemeAppIcon::getIcon(QPixmap &pix, const QString iconName, const int size, bool reObtain)
|
||||
|
@ -592,8 +592,7 @@ bool MainPanelControl::eventFilter(QObject *watched, QEvent *event)
|
||||
}
|
||||
|
||||
if (m_appDragWidget && watched == static_cast<QGraphicsView *>(m_appDragWidget)->viewport()) {
|
||||
QDropEvent *e = static_cast<QDropEvent *>(event);
|
||||
bool isContains = rect().contains(mapFromGlobal(m_appDragWidget->mapToGlobal(e->pos())));
|
||||
bool isContains = rect().contains(mapFromGlobal(QCursor::pos()));
|
||||
if (isContains) {
|
||||
if (event->type() == QEvent::DragMove) {
|
||||
handleDragMove(static_cast<QDragMoveEvent *>(event), true);
|
||||
|
@ -541,6 +541,10 @@ bool XEmbedTrayWidget::isBadWindow()
|
||||
auto c = QX11Info::connection();
|
||||
|
||||
auto cookie = xcb_get_geometry(c, m_windowId);
|
||||
QScopedPointer<xcb_get_geometry_reply_t> clientGeom(xcb_get_geometry_reply(c, cookie, Q_NULLPTR));
|
||||
return clientGeom.isNull();
|
||||
xcb_get_geometry_reply_t *clientGeom = xcb_get_geometry_reply(c, cookie, Q_NULLPTR);
|
||||
bool result = clientGeom ? false : true;
|
||||
|
||||
free(clientGeom);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user