Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8021017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:51:09+00:00 2026-06-04T21:51:09+00:00

When I run my application in debug mode, sometimes I get a runtime error

  • 0

When I run my application in debug mode, sometimes I get a runtime error in this function:

void ChatListHandler::seatOccupancyChanged( const std::string& userName, bool occupied, bool isSelf, bool isSelfTable, int tableNo, int seatNo, int numPlayersAtTable )
{
    if(!isSelf && (isInGroup(userName,IN_GAME_GROUP) || isInGroup(userName,IN_LOBBY_GROUP)))
    {
        if(occupied)
        {
            movePlayer(userName,IN_GAME_GROUP);
        }
        else
        {
            movePlayer(userName,IN_LOBBY_GROUP);
        }
    }
}

bool ChatListHandler::isInGroup( const std::string& name, GroupTypeEnum group )
{
    for(size_t i = 0; i < m_groups.size(); ++i)
    {
        if(m_groups[i].second == group)
        {
            if(m_groups[i].first->getList())
            {
                for(agui::ListItem::iterator it = 
                    m_groups[i].first->getList()->getItemsBegin(); it !=
                    m_groups[i].first->getList()->getItemsEnd(); ++it)
                {
                    if((*it).first.text == name)
                    {
                        return true;
                    }
                }
            }

            break;
        }
    }

    return false;

    m_list->repositionGroups();
}

It crashes on:

if((*it).first.text == name)

I get:

Unhandled exception at 0x5fd1942c (msvcp90d.dll) in my.exe: 0xC0000005: Access violation reading location 0x00000040.

The call stack looks like:
enter image description here

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:51:12+00:00Added an answer on June 4, 2026 at 9:51 pm

    I can’t be sure without seeing all the code, but my guess is that there error has to do with these lines:

    for(agui::ListItem::iterator it =
                    m_groups[i].first->getList()->getItemsBegin(); it !=
                    m_groups[i].first->getList()->getItemsEnd(); ++it)
    

    Unless your call to getList() is always returning exactly the same list every time (that is, a pointer to the same list, not a copy), you could be getting iterators over different lists. This would mean that the check it != m_groups[i].first->getList()->getItemsEnd() would always be false, since the iterators come from different lists. In that case, your iterator could walk off the end of the list, so the dereference would cause a crash.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im writing application in c++ and after try to run built (in debug mode)
I am trying to run my Java application in debug mode in Eclipse, but
I have a large application containing chained function calls, like this: subsystem. do_stuff(cfg().get(x)). do_stuff(cfg().get(y));
I want to debug my application by VS but when the application should run,
I have this strange issue. When I run application from Xcode (even on device),
When I run my application it does not launch, and shows me this message
I want to write an application which has 2 EJBs. This application can run
Im having a problem installing my service application. When I'm running my debug mode
Possible Duplicate: Determine if a java application is in debug mode in Eclipse I
Right now whenever I run application It creates a file (file name specified in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.