#define lprintf(args...) fprintf(stderr, args)
+// WebThreadLocked {{{
+struct WebThreadLocked {
+ _finline WebThreadLocked() {
+ WebThreadLock();
+ }
+
+ _finline ~WebThreadLocked() {
+ WebThreadUnlock();
+ }
+};
+// }}}
+
template <typename Type_>
static inline void CYRelease(Type_ &value) {
if (value != nil) {
error_ = false;
- WebThreadLock();
+ WebThreadLocked lock;
[webview_ loadRequest:request];
- WebThreadUnlock();
}
- (void) reloadURL {
if (button == [alert cancelButtonIndex]) {
} else if (button == [alert firstOtherButtonIndex]) {
if (request_ != nil) {
- WebThreadLock();
+ WebThreadLocked lock;
[webview_ loadRequest:request_];
- WebThreadUnlock();
}
}
}
- (void) callFunction:(WebScriptObject *)function {
- WebThreadLock();
+ WebThreadLocked lock;
WebView *webview([[webview_ _documentView] webView]);
WebFrame *frame([webview mainFrame]);
settings->setJavaScriptCanOpenWindowsAutomatically(no);*/
[preferences setJavaScriptCanOpenWindowsAutomatically:maybe];
-
- WebThreadUnlock();
}
- (void) reloadButtonClicked {