OSDN Git Service

Forgot to free glue_spec object defined by \ltj@safe@glue
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 26 Jan 2014 10:37:37 +0000 (19:37 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 26 Jan 2014 10:37:37 +0000 (19:37 +0900)
Note: in present implementation of LuaTeX-ja,
a skip will be stored in the stack table as a table, not a glue_spec.

src/luatexja-core.sty

index 6c78871..13a572f 100644 (file)
 \protected\def\zw{\directlua{luatexja.jfont.load_zw()}\ltj@zw}
 \protected\def\zh{\directlua{luatexja.jfont.load_zh()}\ltj@zh}
 
-
 %%%%%%%% \inhibitglue
 \protected\def\ltj@reset@globaldefs{%
   \directlua{luatexja.global_temp = tex.globaldefs; tex.globaldefs = 0}}
 \setbox0\hbox{%
   \directlua{% This value depends on the version of LuaTeX.
     luatexja.stack.hmode = -tex.nest[tex.nest.ptr].mode
-  }
+  }%
 }
 
 % prebreakpenalty = {<char_code>, <penalty>}
 
 % [x]]kanjiskip = <dimen>
 \define@key[ltj]{japaram}{kanjiskip}{%              % SKIP
-  \directlua{luatexja.stack.set_stack_skip('kanjiskip', \ltj@safe@glue{#1})}}
+  \directlua{%
+    local d = \ltj@safe@glue{#1}
+    luatexja.stack.set_stack_skip('kanjiskip', d); node.free(d)
+}}
 \define@key[ltj]{japaram}{xkanjiskip}{%             % SKIP
-  \directlua{luatexja.stack.set_stack_skip('xkanjiskip', \ltj@safe@glue{#1})}}
+  \directlua{%
+    local d = \ltj@safe@glue{#1}
+    luatexja.stack.set_stack_skip('xkanjiskip', d); node.free(d)
+}}
 
 % jcharwidowpenalty = <count>
 \define@key[ltj]{japaram}{jcharwidowpenalty}{%      %COUNT