Changeset 4682:81697d18517b in roaraudio


Ignore:
Timestamp:
12/22/10 02:16:55 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

avoid to segfaul if a non-sched plugin is loaded, or any other file not doing sched.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/plugins.c

    r4680 r4682  
    6060   _pp = &(g_plugins[i]); 
    6161 
     62   _pp->sched = NULL; 
     63 
    6264   roar_dl_ra_init(g_plugins[i].lhandle, NULL); 
    6365 
    64    if ( g_plugins[i].sched->init != NULL ) 
    65     g_plugins[i].sched->init(); 
     66   if ( g_plugins[i].sched != NULL ) 
     67    if ( g_plugins[i].sched->init != NULL ) 
     68     g_plugins[i].sched->init(); 
    6669 
    6770   _pp = NULL; 
     
    7780 for (i = 0; i < MAX_PLUGINS; i++) { 
    7881  if ( g_plugins[i].lhandle != NULL ) { 
    79    if ( g_plugins[i].sched->free != NULL ) 
    80     g_plugins[i].sched->free(); 
     82   if ( g_plugins[i].sched != NULL ) 
     83    if ( g_plugins[i].sched->free != NULL ) 
     84     g_plugins[i].sched->free(); 
    8185 
    8286   roar_dl_close(g_plugins[i].lhandle); 
     
    9397 for (i = 0; i < MAX_PLUGINS; i++) 
    9498  if ( g_plugins[i].lhandle != NULL ) 
    95    if ( g_plugins[i].sched->update != NULL ) 
    96     if ( g_plugins[i].sched->update() == -1 ) 
    97      ret = -1; 
     99   if ( g_plugins[i].sched != NULL ) 
     100    if ( g_plugins[i].sched->update != NULL ) 
     101     if ( g_plugins[i].sched->update() == -1 ) 
     102      ret = -1; 
    98103 
    99104 return ret; 
Note: See TracChangeset for help on using the changeset viewer.