From 4aabb8525e95af161e916a8dfb85fbf994bb7aeb Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Wed, 23 Feb 2022 17:39:47 +0100 Subject: [PATCH] Fix crash caused by Visualizer::close on Windows by switching used Irrlicht Device on Windows to `irr::EIDT_SDL` (#976) * Fix crash caused by Visualizer::close on Windows * Update CHANGELOG.md --- CHANGELOG.md | 3 +++ CMakeLists.txt | 2 +- src/visualization/src/Visualizer.cpp | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3730cdbcb1a..7abd5102be6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased Major] +## [5.0.1] - 2022-02-23 + ### Fixed - Avoid to use iDynTree material (for example the one specified in URDF) when `.obj` meshes are loaded in the Irrlicht visualizer (https://github.com/robotology/idyntree/pull/974). +- Fix crash on `Visualizer::close` on Windows (https://github.com/robotology/idyntree/pull/976). The fix works only if the used Irrlicht is compiled with SDL support. ## [5.0.0] - 2022-02-08 diff --git a/CMakeLists.txt b/CMakeLists.txt index df85a8b77da..44f4050434d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.16) -project(iDynTree VERSION 5.0.0 +project(iDynTree VERSION 5.0.1 LANGUAGES C CXX) # Disable in source build, unless Eclipse is used diff --git a/src/visualization/src/Visualizer.cpp b/src/visualization/src/Visualizer.cpp index 1192f4e38e3..55107cc6e02 100644 --- a/src/visualization/src/Visualizer.cpp +++ b/src/visualization/src/Visualizer.cpp @@ -267,6 +267,12 @@ bool Visualizer::init(const VisualizerOptions &visualizerOptions) irr::SIrrlichtCreationParameters irrDevParams; +// If we are on Windows and the SDL backend of Irrlicht is available, +// let's use it to avoid spurios WM_QUIT signal being raised in the +// close() method, see https://github.com/robotology/idyntree/issues/975 +#if defined(_WIN32) && defined(_IRR_COMPILE_WITH_SDL_DEVICE_) + irrDevParams.DeviceType = irr::EIDT_SDL; +#endif irrDevParams.DriverType = irr::video::EDT_OPENGL; irrDevParams.WindowSize = irr::core::dimension2d(visualizerOptions.winWidth, visualizerOptions.winHeight); irrDevParams.WithAlphaChannel = true;