mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 15:20:05 +00:00
Fix GlContext destruction of OpenGLFunctions causing crash
This commit is contained in:
parent
d6e574c877
commit
46cd75cff4
2 changed files with 36 additions and 27 deletions
|
|
@ -190,6 +190,8 @@ public:
|
|||
map::MapProvider mapProvider_;
|
||||
map::MapWidget* activeMap_;
|
||||
|
||||
std::shared_ptr<gl::GlContext> glContext_ {nullptr};
|
||||
|
||||
ui::CollapsibleGroup* mapSettingsGroup_;
|
||||
ui::CollapsibleGroup* level2ProductsGroup_;
|
||||
ui::CollapsibleGroup* level2SettingsGroup_;
|
||||
|
|
@ -777,7 +779,7 @@ void MainWindowImpl::ConfigureMapLayout()
|
|||
}
|
||||
};
|
||||
|
||||
auto glContext = std::make_shared<gl::GlContext>();
|
||||
glContext_ = std::make_shared<gl::GlContext>();
|
||||
|
||||
for (int64_t y = 0; y < gridHeight; y++)
|
||||
{
|
||||
|
|
@ -790,7 +792,7 @@ void MainWindowImpl::ConfigureMapLayout()
|
|||
{
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-owning-memory): Owned by parent
|
||||
maps_[mapIndex] =
|
||||
new map::MapWidget(mapIndex, settings_, glContext);
|
||||
new map::MapWidget(mapIndex, settings_, glContext_);
|
||||
}
|
||||
|
||||
hs->addWidget(maps_[mapIndex]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue