mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
[ruamoko] Fix incorrect clearing of dtables
The problem was caused by passing the index into the dtables array to dtable_get which expects a handle. A handle is the ones-compliment negative of the index which means that handle 0 is invalid (but 0 was being passed... oops). Fixes the segfault when qw-client-x11 connects to a server.
This commit is contained in:
parent
3413947e0c
commit
62c20aa4ab
1 changed files with 4 additions and 1 deletions
|
@ -2192,7 +2192,10 @@ rua_obj_cleanup (progs_t *pr, void *data)
|
|||
}
|
||||
|
||||
for (i = 0; i < probj->dtables._size; i++) {
|
||||
dtable_t *dtable = dtable_get (probj, i);
|
||||
/* dtable_get expects a handle, but a handle is the ones-compliment
|
||||
* negative of the index.
|
||||
*/
|
||||
dtable_t *dtable = dtable_get (probj, ~i);
|
||||
if (!dtable->imp) {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue