Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.6.1, 6.6.2
-
None
Description
The Documentation of QPlainTextEdit::createStandardContextMenu(const QPoint &position) states that: "The popup menu's ownership is transferred to the caller." This is not 100% correct, as inside the implementation "this" is set as the parent of the menu in QPlainTextEdit::createStandardContextMenu() and in QPlainTextEdit::createStandardContextMenu(QPoint...).
If a user tries to write code like this:
QMenu *menu = plainTextControl->createStandardContextMenu();
menu->exec();
delete menu;
a crash can happen when calling delete menu; if the plainTextControl is already destroyed during the exec.
Also while the documentation of the function with argument states the incorrect, the documentation of the function without the argument does not. They should both state it or none of them.