diff options
author | Piotr Szydelko <p.szydelko@samsung.com> | 2016-11-04 11:56:53 +0100 |
---|---|---|
committer | Piotr Szydelko <p.szydelko@samsung.com> | 2016-11-08 12:37:54 +0100 |
commit | 3fd6525de3a351eecc8bff0540248c9e1d309eb6 (patch) | |
tree | c5f03193d8e6fffc229aef83982520f0967f8fd9 /Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs | |
parent | 49da6041961c55c3c0159393b1a4b0a0e0904f33 (diff) | |
download | xamarin-forms-3fd6525de3a351eecc8bff0540248c9e1d309eb6.tar.gz xamarin-forms-3fd6525de3a351eecc8bff0540248c9e1d309eb6.tar.bz2 xamarin-forms-3fd6525de3a351eecc8bff0540248c9e1d309eb6.zip |
Fix NullReferenceException in TizenPlatformServices.StartTimer
The change ensures that the timer object is not being referenced
before it is initialized.
TASK=TCAPI-1957
Change-Id: I58790a111f63fafcc133eef570cab8b872c823bf
Signed-off-by: Piotr Szydelko <p.szydelko@samsung.com>
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs b/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs index 37354959..a959fa10 100644 --- a/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs +++ b/Xamarin.Forms.Platform.Tizen/TizenPlatformServices.cs @@ -136,7 +136,9 @@ namespace Xamarin.Forms.Platform.Tizen ); } }; - timer = new Timer(onTimeout, null, interval, interval); + timer = new Timer(onTimeout, null, Timeout.Infinite, Timeout.Infinite); + // set interval separarately to prevent calling onTimeout before `timer' is assigned + timer.Change(interval, interval); } public async Task<Stream> GetStreamAsync(Uri uri, CancellationToken cancellationToken) |