if(ip != NULL && (i == 0 || ip != drumset[0]->tone[j].instrument)) 
if(ip != NULL && ip->type == INST_SF2 && (i == 0 || ip != drumset[0]->tone[j].instrument)) 
void free_instruments(int reload_default_inst){    int i = 128 + map_bank_counter, j;    struct InstrumentCache *p;    ToneBank *bank;    Instrument *ip;    struct InstrumentCache *default_entry;    int default_entry_addr;    clear_magic_instruments();    /* Free soundfont instruments */    while(i--)    {	/* Note that bank[*]->tone[j].instrument may pointer to	   bank[0]->tone[j].instrument. See play_midi_load_instrument()	   at playmidi.c for the implementation */	if((bank = tonebank[i]) != NULL)	    for(j = 127; j >= 0; j--)	    {		ip = bank->tone[j].instrument;		if(ip != NULL && (i == 0 || ip != tonebank[0]->tone[j].instrument))		    free_instrument(ip);		bank->tone[j].instrument = NULL;	    }	if((bank = drumset[i]) != NULL)	    for(j = 127; j >= 0; j--)	    {		ip = bank->tone[j].instrument;		if(ip != NULL && (i == 0 || ip != drumset[0]->tone[j].instrument))		    free_instrument(ip);		bank->tone[j].instrument = NULL;	    }    }    /* Free GUS/patch instruments */    default_entry = NULL;    default_entry_addr = 0;    for(i = 0; i < INSTRUMENT_HASH_SIZE; i++)    {	p = instrument_cache[i];	while(p != NULL)	{	    if(!reload_default_inst && p->ip == default_instrument)	    {		default_entry = p;		default_entry_addr = i;		p = p->next;	    }	    else	    {		struct InstrumentCache *tmp;		tmp = p;		p = p->next;		free_instrument(tmp->ip);		free(tmp);	    }	}	instrument_cache[i] = NULL;    }    if(reload_default_inst)	set_default_instrument(NULL);    else if(default_entry)    {	default_entry->next = NULL;	instrument_cache[default_entry_addr] = default_entry;    }}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/2c683e8f9ac44b5f0682f5c52ac89a994aff62f8/instrum.c/buggy/timidity/instrum.c