mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-21 05:43:10 -07:00
Lock m_renderMain in Grapher::TryInitializeGraph to avoid modifying m_graph during rendering (#1430)
This commit is contained in:
parent
483dacbeff
commit
296cf038b9
1 changed files with 5 additions and 5 deletions
|
@ -1085,7 +1085,6 @@ void Grapher::OnGraphBackgroundPropertyChanged(Windows::UI::Color /*oldValue*/,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Grapher::OnGridLinesColorPropertyChanged(Windows::UI::Color /*oldValue*/, Windows::UI::Color newValue)
|
void Grapher::OnGridLinesColorPropertyChanged(Windows::UI::Color /*oldValue*/, Windows::UI::Color newValue)
|
||||||
{
|
{
|
||||||
if (m_renderMain != nullptr && m_graph != nullptr)
|
if (m_renderMain != nullptr && m_graph != nullptr)
|
||||||
|
@ -1113,6 +1112,7 @@ void Grapher::OnLineWidthPropertyChanged(double oldValue, double newValue)
|
||||||
|
|
||||||
optional<vector<shared_ptr<Graphing::IEquation>>> Grapher::TryInitializeGraph(bool keepCurrentView, const IExpression* graphingExp)
|
optional<vector<shared_ptr<Graphing::IEquation>>> Grapher::TryInitializeGraph(bool keepCurrentView, const IExpression* graphingExp)
|
||||||
{
|
{
|
||||||
|
critical_section::scoped_lock lock(m_renderMain->GetCriticalSection());
|
||||||
if (keepCurrentView || IsKeepCurrentView)
|
if (keepCurrentView || IsKeepCurrentView)
|
||||||
{
|
{
|
||||||
auto renderer = m_graph->GetRenderer();
|
auto renderer = m_graph->GetRenderer();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue