Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Strange memory allocation in Qt for Android

$
0
0
Sources of clipboard for android: QMimeData *QAndroidPlatformClipboard::mimeData(QClipboard::Mode mode) {     ...       QMimeData *mimeData = new QMimeData();     mimeData->setText(QtAndroidClipboard::clipboardText());     return mimeData; } Is there a memory leak? On all other platforms that method returns pointer to class field. Next, qandroidplatformintegration.h/cpp: header: ... private:     QPlatformClipboard *m_androidPlatformClipboard; ... constructor: ...     m_androidPlatformClipboard = new QAndroidPlatformClipboard();     ... no sign of presence of this field anywhere else – neither in destructor, neither in function that returns clipboard: QPlatformClipboard *QAndroidPlatformIntegration::clipboard() const { static QAndroidPlatformClipboard *clipboard = 0;     if (!clipboard)         clipboard = new QAndroidPlatformClipboard;       return clipboard; } Am I novice, or are there memory leaks around?

Viewing all articles
Browse latest Browse all 13965

Trending Articles