diff options
author | epoch <epoch@thebackupbox.net> | 2020-04-23 15:38:15 -0500 |
---|---|---|
committer | epoch <epoch@thebackupbox.net> | 2020-04-23 15:38:15 -0500 |
commit | bb67c0b32049a17b01717bdf773639175528adfa (patch) | |
tree | d0bdd7438e363b85139269a4f7d37c7d86a6c00a /src | |
parent | f2ecd9110767ba6b82d52d349942a5340fa0a6bd (diff) | |
download | hackvr-bb67c0b32049a17b01717bdf773639175528adfa.tar.gz hackvr-bb67c0b32049a17b01717bdf773639175528adfa.zip |
forgot to prevent the deletion commands from trying to free the camera struct. will probably allow that in the future. dynamic cameras and stuff. :)
Diffstat (limited to 'src')
-rw-r--r-- | src/hackvr.c | 20 |
1 files changed, 12 insertions, 8 deletions
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); + } } } } |