lib/flashplayer/system_mixins.rb in flashsdk-1.0.18.pre vs lib/flashplayer/system_mixins.rb in flashsdk-1.0.20.pre
- old
+ new
@@ -61,19 +61,29 @@
# All others inherit from this class
class UnixSystem
def open_flashplayer_with exe, swf
+ player_open = false
trap("INT") {
close_flashplayer
@player_thread.kill
}
@player_thread = Thread.new {
require 'open4'
@player_pid, stdin, stdout, stderr = Open4.popen4("#{exe} #{swf}")
+ player_open = true
stdout.read
}
+
+ # Wait until the player process has actually
+ # openned...
+ while !player_open
+ sleep 0.1
+ end
+
+ @player_thread
end
private
def close_flashplayer