|
|
| Strange segmentation fault |
|
Ariesnl
Member #2,902
November 2002
|
Any ideas ? {"name":"610604","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/a\/1a2ac7fd604298cb0ea906896223d910.png","w":1280,"h":1024,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/a\/1a2ac7fd604298cb0ea906896223d910"} Marked line jumps to this ... 1void TMenuItem::ProcessMouseEvent(ALLEGRO_MOUSE_EVENT * mouse_event)
2{
3 if ((mouse_event->x > m_nX) &&
4 (mouse_event->x < m_nX + m_nWidth) &&
5 (mouse_event->y > m_nY) &&
6 (mouse_event->y < m_nY + m_nHeight))
7 {
8 m_blHighlight = true;
9 if ((m_pCallBack!=NULL)&&(mouse_event->button == 1))
10 {
11 m_pCallBack();
12 }
13 }
14 else
15 {
16 //TODO (Anyone #1#): when clicking a menu item sometimes this generates an annoying segmentation fault
17 m_blHighlight = false;
18 }
19}
And this causes a segmentation fault
Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard) |
|
Elias
Member #358
May 2000
|
Where is the ALLEGRO_MOUSE_EVENT allocated? -- |
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
It appears that your mouse event is bad. Either you didn't allocate it and its uninitialized, or you destroyed it and didn't set it to zero. The address stored in mouse_event seems off. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|
bamccaig
Member #7,536
July 2006
|
The address seems close to argv. Could that just be where the globals are allocated? shrug Is there any threading shenanigans going on? -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
|
Ariesnl
Member #2,902
November 2002
|
I was deleting and rebuilding the menu at some point.. Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard) |
|
|