video.attachNetStream( null );
video.clear();
An Adobe AIR application can restart itself, using the code found in this StackOverflow question. However, it does not seem to work always in our application. We are creating new NativeWindows to allow the user to detach a window from the main application window to support using multiple monitors. The problem seemed to be more frequent when windows were detached.
After more investigation, it seemed that not the detached windows, but the video playing the detached windows was the problem. We now first make sure we stop all video that is playing before we do the restart code. We are using the Video class in our application, so we stop it like this:
video.attachNetStream( null );
video.clear();
This way, the restarts of our application have become reliable.