Skip to content

Commit 2fca075

Browse files
committed
xinv3d (1.9.0), 2024 May 9
Selecting "Titlebar" to exit, now cleans-up xinvaders3d memory usage better before exiting program. Also removed 1of4 memory issues from: valgrind --leak-check=full --show-leak-kinds=all ./xinvaders3d 3of4, and 4of4, look like realloc() which is out of reach of program (more info shown in pull request 4).
1 parent 6ed2b68 commit 2fca075

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Andreas Jeitler
1010
Chris Butler
1111
Peter da Silva
1212
Joe Da Silva
13+
William Lupinacci

Changelog

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
xinv3d/xinvaders3d (1.8.0)
1+
xinvaders3d or xinv3d (1.9.0)
2+
* Thanks to orchardstreet for fixing titlebar to exit cleanly
3+
and also for simplifying player left/right rotation return.
4+
-- Joe Da Silva <[email protected]> 2024 May 09
5+
6+
xinvaders3d or xinv3d (1.8.0)
27
* Added build option "./configure --enable-as-xinv3d" so that
38
Xinvaders3D builds binary, man file, and desktop as Xinv3D.
49
* Added desktop scalable icon.

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
AC_PREREQ(2.61)
77

8-
m4_define([xinvaders3d_version], [1.8.0])
8+
m4_define([xinvaders3d_version], [1.9.0])
99
AC_INIT([xinvaders3d],[xinvaders3d_version],[https://github.com/JoesCat/xinvaders3d/issues],
1010
[xinvaders3d],[https://github.com/JoesCat/xinvaders3d])
1111
AC_CONFIG_SRCDIR([aliens.c])

main-x11.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ void Graphics_shutdown ( void )
270270
XAutoRepeatOn ( display );
271271

272272
XCloseDisplay ( display );
273+
274+
free ( wname.value );
273275
}
274276

275277
/*================================================================*/
@@ -487,8 +489,8 @@ int Handle_events ( void )
487489
if ( event.xclient.data.l[0] >= 0 && ((unsigned long int) \
488490
event.xclient.data.l[0]) == wmDeleteMessage )
489491
{
490-
Graphics_shutdown ();
491-
exit(0);
492+
/* titlebar quit! */
493+
return FALSE;
492494
}
493495
break;
494496

player.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ void Player_update1 ( OBJECT *obj )
161161
player1->rot = -MAX_ROT;
162162
}
163163

164-
if ( (gv->key_LEFT1 == FALSE) && (gv->key_RIGHT1 == FALSE) && \
165-
player1->rot )
164+
if ( player1->rot && gv->key_LEFT1 == FALSE && gv->key_RIGHT1 == FALSE )
166165
{
167166
if ( player1->rot > 0 )
168167
{
@@ -232,8 +231,7 @@ void Player_update2 ( OBJECT *obj )
232231
player2->rot = -MAX_ROT;
233232
}
234233

235-
if ( (gv->key_LEFT2 == FALSE) && (gv->key_RIGHT2 == FALSE) && \
236-
player2->rot )
234+
if ( player2->rot && gv->key_LEFT2 == FALSE && gv->key_RIGHT2 == FALSE )
237235
{
238236
if ( player2->rot > 0 )
239237
{

0 commit comments

Comments
 (0)