New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running app one day without touching it craching after move to other page #21576
Comments
There is a timer running in main page , please look on OnAppearing+ OnDisappearing event. |
Before you run the app published as exe |
Verified this issue with Visual Studio 17.10.0 Preview 2(8.0.14). Can repro on windows platform with sample project. |
Did you reproduced on windows platform. |
protected override void OnAppearing()
{
base.OnAppearing();
MainThread.BeginInvokeOnMainThread(() =>
{
serviceButton.TextColor = Color.FromRgb(0, 128, 0);
});
if (_timer == null)
{
var dispatcher = this.Dispatcher;
_timer = dispatcher.CreateTimer();
_timer.Interval = TimeSpan.FromSeconds(30);
_timer.Tick += (s, e) =>
{
MainThread.BeginInvokeOnMainThread(() =>
{
serviceButton.TextColor = Color.FromRgb(128, 0, 0);
});
};
_timer.IsRepeating = true;
_timer.Start();
}
}
protected override void OnDisappearing()
{
base.OnDisappearing();
if (_timer != null)
{
_timer.Stop();
}
} If you remove this DispatchTimer, does it stop crashing? |
@drasticactions |
It's trying to isolate if the issue is MAUI specific, or if having an ever-increasing DispatcherTimer is causing issues in Windows in general. The code you're calling is from MAUI essentials, which implements Windows functions. If you ran the underlying code creating the Dispatcher Timer in a WinUI app and had the same crash after leaving it on, it would most likely be a WinUI/Windows issue. If you remove the timer and it still crashes, then there testing would be more needed to isolate why it crashes for you. |
Evrerything is OK. |
Thank you |
Description
Hi,
I have app that when i run it all day without touching it after login
and move to next page is carched.
Steps to Reproduce
1.Run the app.
2.Login
3Leavethe app running to one day and later move to another page.
4.App crached.
FlyoutExample (1).zip
Link to public reproduction project repository
...
Version with bug
8.0.3 GA
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
7.0.101
Affected platforms
Windows
Affected platform versions
....
Did you find any workaround?
No
Relevant log output
The text was updated successfully, but these errors were encountered: