| Summary: | Frequent crashes in Touch events by simply touching the screen (currently in iPhone Simulator) | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Pavel Kanzelsberger <kanzels> |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | critical | ||
| Priority: | P2 | CC: | joseba.gar, kanzels |
| Version: | HG 2.0 | ||
| Hardware: | iPhone/iPod touch | ||
| OS: | iOS 3 | ||
|
Description
Pavel Kanzelsberger
2010-09-21 06:41:30 UTC
I believe the crash is caused by a check not being performed on wether an SDL_Touch element is NULL before using it in the SDL_SendTouchMotion function in src/events/SDL_touch.c around line 400.
Judging from the rest of the code, there's a missing
if (!touch) {
return 0;
}
before using "touch" as SDL_GetFinger(), SDL_GetFingerIndexId() use touch->num_fingers without checking.
I can attach a patch if you like. It seems pretty straightforward, though.
I have yet to discover why touch is being returned as NULL as this error is only triggered when an actual gesture has been performed, maybe something related to SDL_AddTouch()?
If it serves of any help I'm compiling from standard Makefile's, not from XCode. The "Touch" and "Fireworks" demos in the repository seem to be working fine when compiled from Xcode.
I will try to compile those examples with my Makefile to see if missing compilation flags are to be blamed for this.
As additional info, this was happening in iOS 4.2 too, the additional check fixes the crash. This is fixed in the repository, thanks! |