mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
systemtrayicon: image is now stack-allocated
This commit is contained in:
parent
fc41cded7f
commit
7b1b4655a5
@ -107,14 +107,12 @@ SystemTrayIcon::SystemTrayIcon()
|
|||||||
{
|
{
|
||||||
delete reinterpret_cast<QImage*>(image);
|
delete reinterpret_cast<QImage*>(image);
|
||||||
};
|
};
|
||||||
QImage* image = new QImage(":/img/icon.png");
|
QImage image(":/img/icon.png");
|
||||||
if (image->format() != QImage::Format_RGBA8888_Premultiplied)
|
if (image.format() != QImage::Format_RGBA8888_Premultiplied)
|
||||||
*image = image->convertToFormat(QImage::Format_RGBA8888_Premultiplied);
|
image = image.convertToFormat(QImage::Format_RGBA8888_Premultiplied);
|
||||||
GdkPixbuf* pixbuf = gdk_pixbuf_new_from_data(image->bits(), GDK_COLORSPACE_RGB, image->hasAlphaChannel(),
|
GdkPixbuf* pixbuf = gdk_pixbuf_new_from_data(image.bits(), GDK_COLORSPACE_RGB, image.hasAlphaChannel(),
|
||||||
8, image->width(), image->height(),
|
8, image.width(), image.height(),
|
||||||
image->bytesPerLine(), callbackFreeImage, image);
|
image.bytesPerLine(), callbackFreeImage, &image);
|
||||||
|
|
||||||
delete image; // Not needed anymore.
|
|
||||||
|
|
||||||
statusNotifier = status_notifier_new_from_pixbuf("qtox",
|
statusNotifier = status_notifier_new_from_pixbuf("qtox",
|
||||||
STATUS_NOTIFIER_CATEGORY_APPLICATION_STATUS, pixbuf);
|
STATUS_NOTIFIER_CATEGORY_APPLICATION_STATUS, pixbuf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user