From bb67c0b32049a17b01717bdf773639175528adfa Mon Sep 17 00:00:00 2001 From: epoch Date: Thu, 23 Apr 2020 15:38:15 -0500 Subject: forgot to prevent the deletion commands from trying to free the camera struct. will probably allow that in the future. dynamic cameras and stuff. :) --- src/hackvr.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/hackvr.c b/src/hackvr.c index f0cb5a6..b895f58 100644 --- a/src/hackvr.c +++ b/src/hackvr.c @@ -228,10 +228,12 @@ int hackvr_handler(char *line) { for(i=0;i < global.ht_group.kl;i++) {//for each bucket and item in each bucket... for(m=global.ht_group.bucket[global.ht_group.keys[i]]->ll;m;m=m->next) { if(!glob_match(a[2],m->original)) { - gr=m->target; - ht_delete(&global.ht_group,gr->id); - free(gr->id); - free(gr);//pretty sure this does NOT get free()d by ht_delete, because the HT can't /know/ its value is a pointer to something malloc()d + if(m->target != &global.camera) { + gr=m->target; + ht_delete(&global.ht_group,gr->id); + free(gr->id); + free(gr);//pretty sure this does NOT get free()d by ht_delete, because the HT can't /know/ its value is a pointer to something malloc()d + } } } } @@ -263,10 +265,12 @@ int hackvr_handler(char *line) { for(i=0;i < global.ht_group.kl;i++) {//for each bucket and item in each bucket... for(m=global.ht_group.bucket[global.ht_group.keys[i]]->ll;m;m=m->next) { if(!glob_match(a[2],m->original)) { - gr=m->target;//this almost CERTAINLY exists... I think. - ht_delete(&global.ht_group,gr->id); - free(gr->id); - free(gr); + if(m->target != &global.camera) {//ah! don't delete the camera! + gr=m->target;//this almost CERTAINLY exists... I think. + ht_delete(&global.ht_group,gr->id); + free(gr->id); + free(gr); + } } } } -- cgit v1.2.3