Re: releasing memory.

2017-05-18 Thread Dk Jack
My module has c++ code which instantiates a class. I am driving most of my c++ from one ptr which I am saving in the context. I tried changing my code to use pool cleanup, it behaving worse than request->cleanup. Of the four requests I send, the cleanup handler is only getting called for two. I

Re: releasing memory.

2017-05-18 Thread Maxim Dounin
Hello! On Thu, May 18, 2017 at 10:23:18AM -0700, Dk Jack wrote: > I just want to release memory l've allocated. One more question, > is the context memory automatically removed or is the module > responsible for freeing it. Anything you allocate from request pool (r->pool) using

Re: releasing memory.

2017-05-18 Thread Dk Jack
Thank you Maxim, I just want to release memory l've allocated. One more question, is the context memory automatically removed or is the module responsible for freeing it. > On May 18, 2017, at 6:32 AM, Maxim Dounin wrote: > > Hello! > >> On Wed, May 17, 2017 at

Re: releasing memory.

2017-05-18 Thread Maxim Dounin
Hello! On Wed, May 17, 2017 at 05:53:40PM -0700, Dk Jack wrote: > Hi, > In my module, I registered a NGX_HTTP_POST_READ_PHASE handler. When this > handler is invoked, I allocate my module context and attach it to the > request. I also allocate some other memory and save the pointers to that >

releasing memory.

2017-05-17 Thread Dk Jack
Hi, In my module, I registered a NGX_HTTP_POST_READ_PHASE handler. When this handler is invoked, I allocate my module context and attach it to the request. I also allocate some other memory and save the pointers to that memory in my context. In the POST_READ_PHASE handler, I also register a