..:: PCSX2 Forums ::..
Register | Help | Log In |
Register PCSX2 Site Forums Member List Donate View Today's Posts Search

Current time: 03-21-2010, 10:55 PM Hello There, Guest! (Login — Register)

..:: PCSX2 Forums ::.. / PCSX2 Discussion and Support / Bug reporting / [Bug Report & patch] double free & gtk trouble with zeropad under linux

1 user browsing this thread: (0 members, and 1 guest).

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
[Bug Report & patch] double free & gtk trouble with zeropad under linux
Author Message
briaeros007 Offline
Newbie

Posts: 1
Joined: Oct 2009
Location:
Post: #1
[Bug Report & patch] double free & gtk trouble with zeropad under linux
Hello,
I've found two problem with zeropad (svn version) under my linux (debian lenny/squeeze with a 2.6.31)

I use the svn revision 396

The first trouble is : if i open the controller config windows, i close it, then i reopen it, the system will launch me a "double free or corruption" then kill the soft with a sigabrt.

With some investigation, this problem was resolved with this little modification

===================================================================
--- linux.cpp (révision 396)
+++ linux.cpp (copie de travail)
@@ -721,7 +721,8 @@
}

vector<JoystickInfo*>::iterator it;
- FORIT(it, vjoysticks) delete *it;
+ vjoysticks.clear();

vjoysticks.resize(SDL_NumJoysticks());
for(int i = 0; i < (int)vjoysticks.size(); ++i) {

The Joystickinfo must have been deleted elsewhere (but I haven't investigate it), so just clear them will be ok.
I've first try to put "*it" to null after the delete, but it doesn' correct the double free.


The second problem is a bit more funny (always on this plugin)
When I change only a button (with a joystick button), it is saved without trouble.
But if i change more than one, the software display the right buttons, but save only the first ! (for example : if i put triangle with JBut1 and after this square with JBut2 , only jbut1 will be saved).


After a bit more of investigation, i have found that this comportement was caused by "savestate".
I've done a workaround, but i can't say why it doesn't work before.
Here my workaround:
(I just hope that "=" on a vector do a clone )
===================================================================
--- linux.cpp (révision 396)
+++ linux.cpp (copie de travail)
@@ -816,11 +817,18 @@

void JoystickInfo::SaveState()
{
+
#ifdef JOYSTICK_SUPPORT
+ vector<int> a,b;
+ a.resize(numbuttons);
+ b.resize(numaxes);
+
for(int i = 0; i < numbuttons; ++i)
- vbutstate[i] = SDL_JoystickGetButton(joy, i);
+ a[i] = SDL_JoystickGetButton(joy, i);
for(int i = 0; i < numaxes; ++i)
- vaxisstate[i] = SDL_JoystickGetAxis(joy, i);
+ b[i] = SDL_JoystickGetAxis(joy, i);
+ vbutstate=a;
+ vaxisstate=b;
#endif
}
10-25-2009 05:18 PM
Find all posts by this user Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:


Current time: 03-21-2010, 10:55 PM

Contact Us | PCSX2 | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication

Powered By MyBB, © 2002-2010 MyBB Group.
Theme created by IncadudeF and modified by bositman