mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-23 15:22:45 +01:00
bootmanager: Delete container to avoid crash on game restarting
While we are at it, remove nullptr checks for deletion, since the C++ standard defines that delete does it by its own
This commit is contained in:
parent
5f2d9f282a
commit
9ff72ca9f2
2 changed files with 10 additions and 14 deletions
|
@ -340,21 +340,16 @@ std::unique_ptr<Core::Frontend::GraphicsContext> GRenderWindow::CreateSharedCont
|
|||
}
|
||||
|
||||
void GRenderWindow::InitRenderTarget() {
|
||||
if (shared_context) {
|
||||
shared_context.reset();
|
||||
}
|
||||
shared_context.reset();
|
||||
context.reset();
|
||||
|
||||
if (context) {
|
||||
context.reset();
|
||||
}
|
||||
delete child;
|
||||
child = nullptr;
|
||||
|
||||
if (child) {
|
||||
delete child;
|
||||
}
|
||||
delete container;
|
||||
container = nullptr;
|
||||
|
||||
if (layout()) {
|
||||
delete layout();
|
||||
}
|
||||
delete layout();
|
||||
|
||||
first_frame = false;
|
||||
|
||||
|
@ -375,7 +370,7 @@ void GRenderWindow::InitRenderTarget() {
|
|||
fmt.setSwapInterval(false);
|
||||
|
||||
child = new GGLWidgetInternal(this, shared_context.get());
|
||||
QWidget* container = QWidget::createWindowContainer(child, this);
|
||||
container = QWidget::createWindowContainer(child, this);
|
||||
QBoxLayout* layout = new QHBoxLayout(this);
|
||||
|
||||
resize(Layout::ScreenUndocked::Width, Layout::ScreenUndocked::Height);
|
||||
|
|
|
@ -166,7 +166,8 @@ private:
|
|||
void OnMinimalClientAreaChangeRequest(
|
||||
const std::pair<unsigned, unsigned>& minimal_size) override;
|
||||
|
||||
GGLWidgetInternal* child;
|
||||
QWidget* container = nullptr;
|
||||
GGLWidgetInternal* child = nullptr;
|
||||
|
||||
QByteArray geometry;
|
||||
|
||||
|
|
Loading…
Reference in a new issue