platform/bb/rhodes/src/com/rho/rubyext/WebView.java in rhodes-2.4.1 vs platform/bb/rhodes/src/com/rho/rubyext/WebView.java in rhodes-3.0.0.beta.1

- old
+ new

@@ -117,12 +117,19 @@ } }); klass.getSingletonClass().defineMethod("set_cookie", new RubyTwoArgMethod() { protected RubyValue run(RubyValue receiver, RubyValue arg1, RubyValue arg2, RubyBlock block) { try { - String url = arg1.toString(); - String cookie = arg2.toString(); - RhodesApplication.getInstance().setCookie(RhodesApp.getInstance().canonicalizeRhoUrl(url), cookie); + final String url = arg1.toString(); + final String cookie = arg2.toString(); + + RhodesApplication.getInstance().invokeLater( new Runnable() { + public void run() + { + RhodesApplication.getInstance().setCookie(RhodesApp.getInstance().canonicalizeRhoUrl(url), cookie); + } + } ); + return RubyConstant.QNIL; } catch (Exception e) { LOG.ERROR("set_cookie failed.", e); throw (e instanceof RubyException ? (RubyException)e : new RubyException(e.getMessage()));