py_pjsua && destroy()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/13/08, Jo?o Mesquita <jmesquita at contactnet.com.br> wrote:
> Yes, I do have a worker that polls handle_events every 50ms. Why 50ms?
>  Cos I saw on the example ... :D

50ms seems to give good signaling responsiveness without hogging the
CPU with busy polling.

>  The worker is not really a different thread since I am attaching that to
>  the GTK main loop using gobject.timeout_add function.
>
>  Do I have to remove the source before cleaning up?

I have no idea about GTK, but yes you need to somehow stop it before
you call destroy().

>  The __del__ function is the destroyer, but my guess is that py_pjsua is
>  not blocking, so gtk.main_quit() simply kills the loop b4 anything else
>  gets done.

How has blocking or non-blocking got anything to do with it? Like I
said, I have no idea about using GTK with Python, but I would expect
that if you call destroy(), then Python will allow destroy() function
to complete and not just kill it.

cheers,
 -benny


>  Thanks,
>
>
>  Mesquita
>
>
>  On Thu, 2008-03-13 at 21:18 +0000, Benny Prijono wrote:
>  > On 3/13/08, Jo?o Mesquita <jmesquita at contactnet.com.br> wrote:
>  > > I am doing
>  > >  py_pjsua.destroy()
>  > >  gtk.main_quit()
>  >
>  > That's not exactly what I'm asking. In your script, do you have a
>  > worker thread? Or something that calls py_pjsua.handle_events()? Is
>  > so, then this worker thread needs to be stopped before you call
>  > py_pjsua.destroy().
>  >
>  > >  If I wrap py_pjsua on another module/class and call py_pjsua.destroy()
>  > >  on the __del__ method, it simply quits and does no cleanup...
>  >
>  > I'm not sure about this. Maybe py_pjsua.destroy() is not called at all?
>  >
>  > >  What is the cons of doing the latter?
>  > >
>  >
>  > You should make sure that py_pjsua.destroy() is called or otherwise
>  > things don't get cleaned up properly (dangling calls, dangling
>  > registration in the server, etc.).
>  >
>  > cheers,
>  >  -benny
>  >
>  >
>  > >  Mesquita
>  >
>
> > _______________________________________________
>  > Visit our blog: http://blog.pjsip.org
>  >
>  > pjsip mailing list
>  > pjsip at lists.pjsip.org
>  > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
>  _______________________________________________
>  Visit our blog: http://blog.pjsip.org
>
>  pjsip mailing list
>  pjsip at lists.pjsip.org
>  http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux