carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.18k stars 3.61k forks source link

[C++] Can't destroy the world object #5713

Open lowbees opened 2 years ago

lowbees commented 2 years ago

version: Carla 0.9.13, VS2019

see code

#include <iostream>

#include <carla/client/Client.h>
#include <carla/client/World.h>

namespace cc = carla::client;

int main()
{

    {
        cc::Client client("127.0.0.1", 2000);
        auto world = client.GetWorld();
    }

    std::cout << "client end" << std::endl;
    system("pause");   // keep exe running, then stop carla server

    return 0;
}

I use system("pause") to keep exe running, then stop carla server, I will received the info INFO: streaming client: connection failed

comment auto world = client.GetWorld(); is ok

Can someone help me, thanks.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.