fix: No provider being selected in some cases when closing a provider
This commit is contained in:
parent
9dbae2051b
commit
bcab657a06
@ -312,8 +312,12 @@ namespace hex {
|
|||||||
if (it == s_providers.end())
|
if (it == s_providers.end())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!s_providers.empty() && it - s_providers.begin() == s_currentProvider)
|
if (!s_providers.empty()) {
|
||||||
setCurrentProvider(0);
|
if (it == s_providers.begin())
|
||||||
|
setCurrentProvider(0);
|
||||||
|
else if (std::distance(s_providers.begin(), it) < 0)
|
||||||
|
setCurrentProvider(s_currentProvider - 1);
|
||||||
|
}
|
||||||
|
|
||||||
s_providers.erase(it);
|
s_providers.erase(it);
|
||||||
if (s_providers.empty())
|
if (s_providers.empty())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user