Update Javascript memory management a bit.
* bindings/vapi/javascriptcore-4.0.vapi: Don't pretend JS.String will be unreff'ed by vala, it wont. Add JS.GlobalContext.retain, in case it wants to be used. * src/client/components/client-web-view.vala (ClientWebView::ClientWebView): JavascriptResult instances are unref'ed when unowned.
This commit is contained in:
parent
772b874def
commit
503ca3b478
2 changed files with 19 additions and 3 deletions
|
|
@ -5,7 +5,11 @@
|
|||
* (version 2.1 or later). See the COPYING file in this distribution.
|
||||
*/
|
||||
|
||||
[CCode (cprefix = "JS", gir_namespace = "JavaScriptCore", gir_version = "4.0", lower_case_cprefix = "JS_", cheader_filename = "JavaScriptCore/JavaScript.h")]
|
||||
[CCode (cprefix = "JS",
|
||||
gir_namespace = "JavaScriptCore",
|
||||
gir_version = "4.0",
|
||||
lower_case_cprefix = "JS_",
|
||||
cheader_filename = "JavaScriptCore/JavaScript.h")]
|
||||
namespace JS {
|
||||
|
||||
[CCode (cname = "JSContextRef")]
|
||||
|
|
@ -31,8 +35,12 @@ namespace JS {
|
|||
[SimpleType]
|
||||
public struct GlobalContext : Context {
|
||||
|
||||
[CCode (cname = "JSGlobalContextRetain")]
|
||||
public bool retain();
|
||||
|
||||
[CCode (cname = "JSGlobalContextRelease")]
|
||||
public bool release();
|
||||
|
||||
}
|
||||
|
||||
[CCode (cname = "JSType", has_type_id = false)]
|
||||
|
|
@ -120,7 +128,7 @@ namespace JS {
|
|||
|
||||
}
|
||||
|
||||
[CCode (cname = "JSStringRef", ref_function = "JSStringRetain", unref_function = "JSStringRelease")]
|
||||
[CCode (cname = "JSStringRef")]
|
||||
[SimpleType]
|
||||
public struct String {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue