On Sun, 14 Apr 2013 at 23:13:28 +0200, Rodolfo García Peñas (kix) wrote:
> From: "Rodolfo García Peñas (kix)" <[email protected]>
> 
> The screen has a list of applications:
> 
> ----------------8<----------------
> kix@debian:~/src/wmaker/wmaker-crm/src$ grep wapp_list screen.h
>     struct WApplication *wapp_list;    /* list of all aplications */
> kix@debian:~/src/wmaker/wmaker-crm/src$
> ----------------8<----------------
> 
> But this variable was not set before this patch:
> - Was removed in application.c
> - Local variable in session.c
> 
> ----------------8<----------------
> kix@debian:~/src/wmaker/wmaker-crm/src$ grep wapp_list *.c
> application.c:  if (wapp == scr->wapp_list) {
> application.c:          scr->wapp_list = wapp->next;
> session.c:      WMArray *wapp_list = NULL;
> session.c:      wapp_list = WMCreateArray(16);
> session.c:        && (WMGetFirstInArray(wapp_list, (void *)appId) == 
> WANotFound
> session.c:               WMAddToArray(wapp_list, (void *)appId);
> session.c:      WMFreeArray(wapp_list);
> kix@debian:~/src/wmaker/wmaker-crm/src$
> ----------------8<----------------
> 
> This variable is needed to restore the screen without re-create the
> applications structs.
> ---
>  src/application.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/application.c b/src/application.c
> index abe1d2d..6a03775 100644
> --- a/src/application.c
> +++ b/src/application.c
> @@ -143,6 +143,10 @@ WApplication *wApplicationCreate(WWindow * wwin)
>  
>       create_appicon_for_application(wapp, wwin);
>  
> +     /* Save the application in the application list */
> +     wapp->next = scr->wapp_list;
> +     scr->wapp_list = wapp;


If wapp_list was not set before then wapp->next will contain junk
at this point, no?


-- 
To unsubscribe, send mail to [email protected].

Reply via email to