>
> What Ive done is I've created a apps::Master* pointer in the JSON_Service
> class and in the constructor initialization list I called ctr_(new
> apps::Master(srv)) and then in the constructor it self I do
>
> attach(ctr_);
As long as it lives with the JSON service it is ok.
>
> The question -
> It it ok to use a raw pointer - does calling attach() transfer the
> responsibility of deleting the pointer to cppcms::application or should I
> use something like intrusive_ptr and then call attach(ctr_.get())?
>
No, attach transfers the ownership to the parent and have to pass
a raw pointer.
Note, intrusive ptr for application keeps one reference counter
for entire hierarchy
> Cheers,
> Petr
>
Artyom
|