[SCIM] shutdown of FrontEnd module

Cougar liuspider at yahoo.com
Sun May 30 09:33:13 PDT 2004


In fact I implemented just exactly the same
modification in FrontEnd, but it will still cause
segfault.

Thanks all the same.

Hope you finish the property code soon ;)

Cougar

--- James Su <suzhe at tsinghua.org.cn> wrote:
> Sorry, I'm implementing the Property codes. I'll add
> this shutdown API 
> into Panel protocol after that.
> For now, please try the attached patch.
> 
> Regards
> James Su
> 
> Cougar wrote:
> 
> >Hi James_su,
> >
> >I just can not figure out how to shutdown the X11
> >FrontEnd module properly and cleanly.
> >
> >Now "scim_before_implement_properties" CVS scim-lib
> is
> >used and everytime I quit skim, it will crash.
> >
> >So I can not debug skim and improve it. 
> >
> >Could you please add another API into
> FrontEndModule
> >to unload itself completely?
> >
> >Thanks,
> >Cougar
> >
> >
> >	
> >		
> >__________________________________
> >Do you Yahoo!?
> >Friends.  Fun.  Try the all-new Yahoo! Messenger.
> >http://messenger.yahoo.com/ 
> >
> >_______________________________________________
> >scim mailing list
> >scim at freedesktop.org
> >http://freedesktop.org/mailman/listinfo/scim
> >
> >  
> >
> 
> > ? x11-frontend-exit.diff
> ? po/messages.mo
> ? tests/testpanel
> Index: modules/FrontEnd/scim_x11_frontend.cpp
>
===================================================================
> RCS file:
>
/cvsroot/scim/scim-lib/modules/FrontEnd/scim_x11_frontend.cpp,v
> retrieving revision 1.115
> diff -u -r1.115 scim_x11_frontend.cpp
> --- modules/FrontEnd/scim_x11_frontend.cpp	19 May
> 2004 08:55:42 -0000	1.115
> +++ modules/FrontEnd/scim_x11_frontend.cpp	30 May
> 2004 15:19:55 -0000
> @@ -137,7 +137,8 @@
>        m_iconv (String ()),
>        m_backend (backend),
>        m_config (config),
> -      m_old_x_error_handler (0)
> +      m_old_x_error_handler (0),
> +      m_should_exit (false)
>  {
>      if (!_scim_frontend.null () && _scim_frontend
> != this) {
>          throw FrontEndError (
> @@ -534,8 +535,10 @@
>          XFilterEvent (&event, None);
>      }
>  
> +    m_should_exit = false;
> +
>      // Select between the X Server and the Panel
> GUI.
> -    while (1) {
> +    while (!m_should_exit) {
>          read_fds = active_fds;
>  
>          if (select (max_fd + 1, &read_fds, NULL,
> NULL, NULL) < 0) {
> @@ -1814,6 +1817,11 @@
>                              m_config->reload ();
>                      }
>                      break;
> +                case SCIM_TRANS_CMD_EXIT:
> +                    {
> +                        m_should_exit = true;
> +                        return true;
> +                    }
>                  default:
>                      break;
>              }
> Index: modules/FrontEnd/scim_x11_frontend.h
>
===================================================================
> RCS file:
>
/cvsroot/scim/scim-lib/modules/FrontEnd/scim_x11_frontend.h,v
> retrieving revision 1.30
> diff -u -r1.30 scim_x11_frontend.h
> --- modules/FrontEnd/scim_x11_frontend.h	13 May 2004
> 08:54:23 -0000	1.30
> +++ modules/FrontEnd/scim_x11_frontend.h	30 May 2004
> 15:19:55 -0000
> @@ -70,6 +70,8 @@
>  
>      int (*m_old_x_error_handler) (Display *,
> XErrorEvent *);
>  
> +    bool              m_should_exit;
> +
>  public:
>      X11FrontEnd (const BackEndPointer &backend,
>                   const ConfigPointer &config,
> Index: src/scim_socket_transaction.h
>
===================================================================
> RCS file:
>
/cvsroot/scim/scim-lib/src/scim_socket_transaction.h,v
> retrieving revision 1.21
> diff -u -r1.21 scim_socket_transaction.h
> --- src/scim_socket_transaction.h	23 May 2004
> 14:17:10 -0000	1.21
> +++ src/scim_socket_transaction.h	30 May 2004
> 15:20:00 -0000
> @@ -74,6 +74,7 @@
>      SCIM_TRANS_CMD_CLOSE_CONNECTION                
> = 6,
>  
>      SCIM_TRANS_CMD_LOAD_FILE                       
> = 7,
> +    SCIM_TRANS_CMD_EXIT                            
> = 8,
>  
>      //Commands for
> SocketFrontEnd<->SocketServerInstance
>      SCIM_TRANS_CMD_PROCESS_KEYEVENT                
> = 100,
> 



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 



More information about the scim mailing list