Skip to content

Commit

Permalink
Fix crash when screen scale factor greater than 1
Browse files Browse the repository at this point in the history
  • Loading branch information
tishion committed Sep 29, 2022
1 parent 1b67503 commit 47ebc27
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/QCefView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ QCefView::QCefView(const QString url, const QCefSetting* setting, QWidget* paren

setMouseTracking(true);
setFocusPolicy(Qt::WheelFocus);

// create browser
d_ptr->createCefBrowser(this, url, setting);
}

QCefView::QCefView(QWidget* parent /*= 0*/)
Expand All @@ -37,6 +40,11 @@ QCefView::QCefView(QWidget* parent /*= 0*/)
QCefView::~QCefView()
{
qDebug() << this << "is being destructed";

if (d_ptr) {
d_ptr->destroyCefBrowser();
d_ptr.reset();
}
}

void
Expand Down
4 changes: 0 additions & 4 deletions src/details/QCefViewPrivate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,10 @@ QCefViewPrivate::QCefViewPrivate(QCefContextPrivate* ctx,
sLiveInstances.insert(this);

isOSRModeEnabled_ = pContextPrivate_->cefConfig()->WindowlessRenderingEnabled().toBool();

createCefBrowser(view, url, setting);
}

QCefViewPrivate::~QCefViewPrivate()
{
destroyCefBrowser();

sLiveInstances.remove(this);
}

Expand Down

0 comments on commit 47ebc27

Please sign in to comment.