forked from qt-creator/qt-creator
designer: Fix livepreview crash
Show Live Preview can be triggered with key sequence Alt+P even if you are not in the designer view which results in access to invalid pointers. To fix this, replace the check in action handler with safer isValid which checks the validity of view and initialize live preview for valid contexts. Fixes: QTCREATORBUG-29642 Change-Id: I9dd1741f1de2722a7ac715a2726b6effbe91529c Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -33,7 +33,7 @@ const QByteArray livePreviewId = "LivePreview";
|
||||
|
||||
static void handleAction(const SelectionContext &context)
|
||||
{
|
||||
if (context.view()->isAttached()) {
|
||||
if (context.isValid()) {
|
||||
if (context.toggled()) {
|
||||
bool skipDeploy = false;
|
||||
if (const Target *startupTarget = ProjectManager::startupTarget()) {
|
||||
|
Reference in New Issue
Block a user