Skip to content
Snippets Groups Projects
  • Andy Green's avatar
    a7109e6e
    valgrind introduce protocol init and destroy user callbacks · a7109e6e
    Andy Green authored
    
    To get a clean bill of health from valgrind, we have to have a way to
    inform the user code that we're going down and it should free everything
    it is holding that was malloc'd.
    
    This patch introduces LWS_CALLBACK_PROTOCOL_DESTROY which each protocol
    gets when the context is being destroyed and no more activity will come
    after that call.  They can get rid of everything there.
    
    To match it, LWS_CALLBACK_PROTOCOL_INIT is introduced which would allow
    one-time init per protocol too.
    
    Signed-off-by: default avatarAndy Green <andy.green@linaro.org>
    a7109e6e
    History
    valgrind introduce protocol init and destroy user callbacks
    Andy Green authored
    
    To get a clean bill of health from valgrind, we have to have a way to
    inform the user code that we're going down and it should free everything
    it is holding that was malloc'd.
    
    This patch introduces LWS_CALLBACK_PROTOCOL_DESTROY which each protocol
    gets when the context is being destroyed and no more activity will come
    after that call.  They can get rid of everything there.
    
    To match it, LWS_CALLBACK_PROTOCOL_INIT is introduced which would allow
    one-time init per protocol too.
    
    Signed-off-by: default avatarAndy Green <andy.green@linaro.org>