Android: Fix crash, don't add null visible menus to pendingContextMenus

Regression introduced in e3689949ba

Change-Id: I9d3e37733d933e037f04d3a6efaf05607e16d9c5
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
This commit is contained in:
BogDan Vatra 2016-01-10 13:29:23 +02:00
parent 69ab280315
commit 7696ff89c9

View File

@ -93,7 +93,8 @@ namespace QtAndroidMenu
void showContextMenu(QAndroidPlatformMenu *menu, const QRect &anchorRect, JNIEnv *env)
{
QMutexLocker lock(&visibleMenuMutex);
pendingContextMenus.append(visibleMenu);
if (visibleMenu)
pendingContextMenus.append(visibleMenu);
visibleMenu = menu;
menu->aboutToShow();
env->CallStaticVoidMethod(applicationClass(), openContextMenuMethodID, anchorRect.x(), anchorRect.y(), anchorRect.width(), anchorRect.height());