fix(ui): deadlock when exporting transfer function
Description
As of 8ed8ac18, it is not possible to export transfer function anymore. This was not caused by this commit, but I was not able to find which broke that feature.
Steps to reproduce
- Launch Sight Viewer.
- Load an image (any kind).
- Try to export transfer function --> freeze
Proposal
This is a deadlock caused by interactions between sight::module::io::session::SWriter
and STransferFunction::exportPreset()
.
Though I do not really know why, adding an extra scope fixes the issue:
void STransferFunction::exportPreset()
{
const auto writer = service::add<io::base::service::IWriter>("sight::module::io::session::SWriter");
// >>>>>>>>>>>>>>>>>>>>>>> Here <<<<<<<<<<<<<<<<<<<<<<
{
const auto currentTf = m_currentTF.lock();
writer->setInput(currentTf.get_shared(), io::base::service::s_DATA_KEY);
}
service::IService::ConfigType config;
...
Functional specifications
Possible to export transfer functions again.
Technical specifications
See above.
Test plan
Manual testing?