Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8200723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:32:46+00:00 2026-06-07T06:32:46+00:00

I’m working on the Kinect, and sporadically the Kinect makes Visual Studio Crash. It’s

  • 0

I’m working on the Kinect, and sporadically the Kinect makes Visual Studio Crash.

It’s happening when I call the kinectSensor.Start() method after debugging I found out that the Kinect is already in use in another process.

But no other processes is using the Kinect!
It happened one time on the morning after booting my machine and launching the app.
But most of the time it occurs when I launch the Kinect App (in debugging mode in VisualStudio 2010), I stop the application and after some code modification I re-launch the app and that time it doesn’t work, I’ve got the above exception and after 2sec Visual Studio crashes.

Moreover I check if the Kinect is already running and this is not the case (below the state of the Kinect sensor during debugging):

state of kinect sensor (debug mode)

The weirdest thing above all is that sometimes it works fine for weeks, and after that it makes that thing for two days every two/three launches of the app.

The only solution I found on the subject is from one guy with a very similar problem (the only one on the internet?) : Imad Elayyan

When I launch Process Explorer I found the exact same problem of USB port handling (shown on the photo), a mutant process which is not terminated when we close the app.

mutant process for the USB handle of the Kinect

But his solution is not really a long term solution: I have to kill manually the mutant and re-start VisualStudio. Sometimes I have to restart VS 20 times on the morning…

Is there a way to properly close that handle of the usb port (in code?) so that when I close the app it terminate that handle and doesn’t makes VS crash anymore?

Any help would be appreciated, it is really puzzling me and it drives me crazy.

Additional information:

i’m using the SDK1.5 + Kinect for Windows but it was also the case with the SDK1.0 + Kinect XBox360

I’ve already try to debug VS with another instance of VS.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:32:48+00:00Added an answer on June 7, 2026 at 6:32 am

    Ok guys, thanks for caring. I think I found the source of my problem but I still lack an explanation for the handle port.

    Facts:

    1. I have 3 projects in my solution, two classes library: Kinect.dll
      which create the connection to the device, handle the gesture
      recognitionj part and the cursors creation. KinectControls.dll
      which create controls (button, border, chart 3D…) that can
      interact with the cursors. And a test project.

    2. Kinect.dll launch the event of the Kinect + some custom event:
      ColorFrameReady, DepthFrameReady, GestureRecognised…

    3. Most of the event are internal in the assembly, but some are visible
      from outside classes.

    4. Each event registered is unregistered (or so I thought).

    5. I implemented the facade pattern for the Kinect-related
      classes. KinectFacade posseses a KinectStop method which close the
      connection and unregister events.

    Root of the problem:

    When the application was shutting down, the Application.Current.Shutdown() method called KinectStop which stopped the Kinect and the unregistered the handler in the assembly. But in the outside assemblies the unregistration was called after the Kinect closes (even if the unregistration was called on Application.Current.Shutdown() too) which led to a ‘basic/usual’ error. So that I removed the unregistration.

    When you do not unregister of the Kinect event and the Kinect closes (KinectSensor.stop() method called), it (sporadically) keeps the USB handle even if the application is closed and any thread terminated!! And after that: No way to reopen the application (Kinect.Start() crashes) and finally when you try to close Visual studio it crashes (as explained in my question).

    Solution I’ve found

    When KinectStop() is called I use a timer before closing the Kinect so that every classes in outside assemblies can unregister events.

    Moreover from now on no ‘normal’ event are available from the outside classes: the façade handles those events and raises FastSmartWeakEvent which are available from the outside world. It solves memory leaks and could also solve my problem in some situation.

    Since then not handle USB port is keeped and Visual Studio do not crash anymore.

    Summary

    I’ve found the roots of my problem and a solution in order to bypass it. I hope this will help anybody with a similar problem.

    However I’still don’t understand why closing the application and/or calling KinectSensor.Stop() method from the SDK does’nt close all events handler/Threads/processes/Port Handle. And why closing visual studio make it crash even if one of the previous is still running?

    If anyone has a suggestion it will be welcomed?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
Specifically, suppose I start with the string string =hello \'i am \' me And
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.