about summary refs log tree commit diff stats
path: root/res
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-05-03 01:41:38 +0200
committerbptato <nincsnevem662@gmail.com>2024-05-03 01:58:12 +0200
commit970378356d0d7239b332baa37470455391b5e6e4 (patch)
tree87d93162295b12652137193982c5b3c88e1a3758 /res
parentc48f2caedabbcda03724c43935f4175aac3ecf90 (diff)
downloadchawan-970378356d0d7239b332baa37470455391b5e6e4.tar.gz
js: fix various leaks etc.
Previously we didn't actually free the main JS runtime, probably because
you can't do this without first waiting for JS to unwind the stack.
(This has the unfortunate effect that code now *can* run after quit().
TODO: find a fix for this.)

This isn't a huge problem per se, we only have one of these and the OS
can clean it up.  However, it also disabled the JS_FreeRuntime leak
check, which resulted in sieve-like behavior (manual refcounting is
a pain).

So now we choose the other tradeoff: quit no longer runs exitnow, but
it waits for the event loop to run to the end and only then exits the
browser.  Then, before exit we free the JS context & runtime, and also
all JS values allocated by config.

Fixes:

* fix `ad' flag not being set for just one siteconf/omnirule
* fix various leaks (since leak check is enabled now)
* use ptr UncheckedArray[JSValue] for QJS bindings that take an array
* allow JSAtom in jsgetprop etc., also disallow int types other than
  uint32
* do not set a destructor for globals
Diffstat (limited to 'res')
-rw-r--r--res/chawan.html6
-rw-r--r--res/config.toml2
2 files changed, 4 insertions, 4 deletions
diff --git a/res/chawan.html b/res/chawan.html
index 6ce6950b..07c76f84 100644
--- a/res/chawan.html
+++ b/res/chawan.html
@@ -68,9 +68,9 @@ up/down by one row
 <li><kbd>C-f</kbd>, <kbd>C-b</kbd> (or <kbd>PgDn</kbd>, <kbd>PgUp</kbd>)</kbd>:
 scroll up/down by an entire page
 <li><kbd>{number}G</kbd> (or <kbd>{number}gg</kbd>): jump to {number}'th line
-<li><kbd>g0<kbd>: jump to first character of the current line's visible part
-<li><kbd>gc<kbd>: jump to center of the current line's visible part
-<li><kbd>g$<kbd>: jump to last character of the current line's visible part
+<li><kbd>g0</kbd>: jump to first character of the current line's visible part
+<li><kbd>gc</kbd>: jump to center of the current line's visible part
+<li><kbd>g$</kbd>: jump to last character of the current line's visible part
 <li><kbd>{</kbd>, <kbd>}</kbd>: move cursor to the previous/next paragraph
 <li><kbd>-</kbd>, <kbd>+</kbd> (or <kbd>zh</kbd>, <kbd>zl</kbd>): shift
 screen to the left/right by one cell
diff --git a/res/config.toml b/res/config.toml
index a33b187b..21514c63 100644
--- a/res/config.toml
+++ b/res/config.toml
@@ -287,7 +287,7 @@ force-pixels-per-line = false
 
 [[omnirule]]
 match = '^ddg:'
-substitute-url = '(x) => "https://lite.duckduckgo.com/lite/?kp=-1&kd=-1&q=" + encodeURIComponent(x.split(":").slice(1).join(":"))'
+substitute-url = 'x => "https://lite.duckduckgo.com/lite/?kp=-1&kd=-1&q=" + encodeURIComponent(x.split(":").slice(1).join(":"))'
 
 [page]
 # buffer commands