handle nonExist in parse the tree visualization and reclaim memory

This commit is contained in:
Krasimir Angelov
2023-02-23 14:19:48 +01:00
parent 9d330b6fb2
commit 57126f6d28
3 changed files with 24 additions and 1 deletions

View File

@@ -1179,7 +1179,9 @@ graphvizParseTree c opts e =
withForeignPtr marshaller $ \m ->
withGraphvizOptions opts $ \c_opts ->
bracket (withPgfExn "graphvizParseTree" (pgf_graphviz_parse_tree (c_db c) c_revision c_e nullPtr m c_opts)) free $ \c_text ->
peekText c_text
if c_text == nullPtr
then return ""
else peekText c_text
graphvizWordAlignment :: [Concr] -> GraphvizOptions -> Expr -> String
graphvizWordAlignment cs opts e = error "TODO: graphvizWordAlignment"