Bug 19835 - IKScannerDeviceView dispose crash
Summary: IKScannerDeviceView dispose crash
Status: CLOSED INVALID
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: 1.6.9
Hardware: PC Mac OS
: Normal normal
Target Milestone: 1.12.0
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2014-05-15 15:17 UTC by Chris Hamons
Modified: 2015-01-20 10:07 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
CLOSED INVALID

Description Chris Hamons 2014-05-15 15:17:33 UTC
This works in obj-c
    IKScannerDeviceView* view = [[IKScannerDeviceView alloc]init]; [view release];
This crashes in c#
    IKScannerDeviceView view = new IKScannerDeviceView (); view.Dispose ();
Comment 1 Udham Singh 2014-07-15 11:11:46 UTC
I have checked this issue and able to reproduce this. To checked this issue I have followed the steps mentioned below :

1. Create a Xamarin.Mac project.
2. Implemented the code below in method named Main in Main.cs class.

     NSApplication.Init ();
     NSApplication.Main (args);
3. Run the application

Screencast : http://screencast.com/t/wnZCI8uhasaI

Crash Log : https://gist.github.com/Mohit-Kheterpal/477d1be297e20c052dab
Application Output : https://gist.github.com/Mohit-Kheterpal/5f0d942aae319f06951a
Ide Log : https://gist.github.com/Mohit-Kheterpal/3b970face77e6fd969d8

Environment Info : 

=== Xamarin Studio ===

Version 5.2 (build 379)
Installation UUID: 449f40dd-b3f1-4028-9a6b-cca0d1a2307d
Runtime:
	Mono 3.6.0 ((no/c46cf0e)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 306000038

=== Xamarin.Android ===

Version: 4.14.0 (Enterprise Edition)
Android SDK: /Users/360logicaxamarinmacmini/Desktop/android-sdk-macosx
	Supported Android versions:
		1.6   (API level 4)
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.iOS ===

Version: 7.2.6.22 (Enterprise Edition)
Hash: b983743
Branch: 
Build date: 2014-07-13 20:15:09-0400

=== Xamarin.Mac ===

Version: 1.8.0.8

=== Build Information ===

Release ID: 502000379
Git revision: e797f287ff084be87a252fec5fcc1c79c53bd422
Build date: 2014-07-15 03:41:44-04
Xamarin addins: e40cad220f133f3ced5a76d33649afee4d1358c1

=== Operating System ===

Mac OS X 10.8.4
Darwin 360Logicas-Mac-mini.local 12.4.0 Darwin Kernel Version 12.4.0
    Sun Mar 10 18:01:10 PDT 2013
    root:xnu-2050.24.6~1/RELEASE_X86_64 x86_64
Comment 2 Chris Hamons 2014-12-05 12:51:01 UTC
Dispose still crashes us on latest master.
Comment 3 Chris Hamons 2014-12-15 16:54:18 UTC
This appears to be the same as the underlying obj-c:

The following dies the same way:

    IKScannerDeviceView * d = [IKScannerDeviceView new];
    [d release];

It appears the API posts a message for itself or something, and if you dealloc it right away you'll crash trying to use the deallo'ed item. Removing the release makes it go away.
Comment 4 Mohit Kheterpal 2015-01-20 10:07:11 UTC
As per comment 3, this issue is resolved for Chris.

Hence closing this issue.