It looks like JS_smprintf is a version of sprint that allocates a string long enough to hold the expanded message, so you don't have to worry about a big enough char buffer, like you do with sprintf. All good, but it's allocated, and so has to be freed.
Then js had its own heap within itself, that may or may not be known to malloc, so I had to call JS_free(cx, string); I don't think you can just call free. There's a lot of this in my_errorReporter(). Then I read somewhere that I was suppose to use explicitly JS_smprintf_free to free up these sprintf lines. So I guess I used that in jsloc.c, but never in jsdom.c Inconsistent, and yet it all seems to work. I probably could have used js_free everywhere. I don't even know if we need to do this at all, any more, or if the c++ version has a better garbage collector. Probably we still have to do it, because the gc would have no idea when we were done with those strings, as allocated by js_sprintf. That's the history of it as best I can paste together from my memory and fromlooking at the code. Karl Dahlke _______________________________________________ Edbrowse-dev mailing list [email protected] http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev
