Boscop / web-view

Rust bindings for webview, a tiny cross-platform library to render web-based GUIs for desktop applications
MIT License
1.92k stars 175 forks source link

macos webview_cocoa.c unknown error #328

Open 4cecoder opened 8 months ago

4cecoder commented 8 months ago

description

I'm using the master branch in a rust project and it fails to render a webview on macos and the program crashes when instantiating webview according to my debugger my program just quits when this is hit

Issues lie here: https://github.com/Boscop/web-view/blob/master/webview-sys/webview_cocoa.c

https://github.com/Boscop/web-view/blob/82d7cbce6228b1a964673cc0f22944ad808eab42/src/lib.rs#L348

debugger leads

line 61

    if (webview_init(wv) != 0) {
        webview_free(wv);
        return NULL;
    }
    return wv;
}

line 328 in webview_cocoa.c

  id wkPref = ((id(*)(id, SEL))objc_msgSend)((id)__WKPreferences, sel_registerName("new"));

finally src/lib.rs line 348

        let user_data = Box::new(UserData {
            inner: user_data,
            live: Arc::new(RwLock::new(())),
            invoke_handler: Box::new(invoke_handler),
            result: Ok(()),
        });
        let user_data_ptr = Box::into_raw(user_data);
    ### Somethings up with user_data according to the debugging
Screenshot 2024-01-09 at 4 13 59 PM