Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Android] Nonstop create new Thread, after save property #4627

Closed
lander1337 opened this issue Dec 4, 2018 · 2 comments
Closed

[Android] Nonstop create new Thread, after save property #4627

lander1337 opened this issue Dec 4, 2018 · 2 comments

Comments

@lander1337
Copy link

lander1337 commented Dec 4, 2018

Description

After saving properties, new Threads r created nonstop.
For example, in logs u can see:

...
Thread finished: <Thread Pool> #3
The thread 0x3 has exited with code 0 (0x0).
Thread finished: <Thread Pool> #4
The thread 0x4 has exited with code 0 (0x0).
Thread finished: <Thread Pool> #5
Thread started: <Thread Pool> #6
Thread started: <Thread Pool> #7
The thread 0x5 has exited with code 0 (0x0).
Thread finished: <Thread Pool> #2
Thread started: <Thread Pool> #8
The thread 0x2 has exited with code 0 (0x0).
Thread finished: <Thread Pool> #7
The thread 0x7 has exited with code 0 (0x0).
...And so on. 

Steps to Reproduce

For example:

  1. Create new xamarin.forms project
  2. Add button to the main page.
  3. In OnClick handler do - Current.Properties["PROP_KEY"] = "Hi";

Expected Behavior

Create thread pools as much as it need
After finish work(save property), new threads should not be created.

Actual Behavior

After save property, if u w8 for few minutes, u can see that new Threads are started/finished in infinity loop.

Basic Information

  • Version with issue: Xamarin.Forms 3.3.0.967583.
  • Last known good version: -
  • IDE: Visual Studio 15.9.1
  • Platform Target Frameworks:
    • iOS: Not tested
    • Android: Android SDK 7.1
  • Affected Devices: Emulator api 25
@kingces95
Copy link
Contributor

I do not see more threads getting created after I click the button. Please include a reproduction if you observe something different.

@lander1337
Copy link
Author

lander1337 commented Dec 6, 2018

Probably u dont wait enough after hit btn(it's took like 2 min to stop all exist threads and start atleast first new one), I just test on other pc with real device I see that new threads are created. That what I have in App.cs:

        public App()
        {
            InitializeComponent();
            var button = new Button()
            {
                Text = "Save prop",
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center
            };
            button.Clicked += Button_Clicked;
            MainPage = new ContentPage()
            {
                Content = button
            };
        }

        private void Button_Clicked(object sender, EventArgs e)
        {
            Current.Properties["PROP_KEY"] = "PROP_VALUE";
        }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants