Hi,
I'm excessively using Sablotron in a threaded application
and there's obviously a memleak somewhere. The XSLT processing
is the only operation using the amount og memory I'm leaking,
so I guess I'm doing something wrong when using the XSLT
processor. Here's the relevant snippet of code. Please tell
me if I'm doing something wrong here:
char *
message (char *xml,
SablotHandle processor)
{
char *result;
char *message;
char *argums[] =
{
"/_stylesheet", stylesheet,
"/_xmlinput", xml,
"/_output", NULL,
NULL
};
SablotRunProcessor (processor,
"arg:/_stylesheet",
"arg:/_xmlinput",
"arg:/_output",
NULL,
argums);
SablotGetResultArg (processor, "arg:/_output", &result);
message = strdup (result);
SablotFree (result);
return message;
}
The processor is created outside the function. It is used
several times and destroyed when finished. Each thread
creates its own processor. Of course the string returned
by message() is freed once it is no longer needed.
Salut, Sven