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 8799719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:23:56+00:00 2026-06-14T00:23:56+00:00

I was programming a server, I programmed the service and a manager. When I

  • 0

I was programming a server, I programmed the service and a manager. When I stop the server with the UI Server Manager, the server calls a function called “stopServer()”, that function contains the following:

qDebug() << "Stopping the server...";
// Clear the vector and free the memory by deleting pointers
qDebug() << clients.size();
for(int i=0;i<clients.size();i++){
    clients.get(i)->getSocket()->flush();
    clients.get(i)->getSocket()->close();
    clients.get(i)->getSocket()->disconnectFromHost();
    clients.get(i)->getSocket()->waitForDisconnected(3);
}
clients.destroy();
// Close the server
socket_server->close();
// Stop the handler
qDebug() << "Stopped.";

Actually, that “clients” variable it’s only a vector that contains the user data, he close the QTcpSocket for each connection, and then clean the clients variable and reset it to 0.

When I have one connection on the server (the UI Manager works as one of that connection), and I try to stop it, it fails. I removed that vector system. And it’s stills not working, it don’t give me any error, just crashes the application.

If you need all the code, just tell me!

(Sorry for my bad english…)

Update: If I remove “socket_server->close()” it works without any problem.
Update #2: It seems that it’s a problem with a pointer deletion. Idk….

SOLVED: Omg I was a dumb! socket_server was a null pointer… I just fixed that, and that’s it!

  • 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-14T00:23:57+00:00Added an answer on June 14, 2026 at 12:23 am

    Omg I was a dumb! socket_server was a null pointer… I just fixed that, and that’s it!

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

Sidebar

Related Questions

I am programming with SharePoint Service 3.0/SharePoint Server 2007. SharePoint has some built-in roles
I've read http://dbaspot.com/sqlserver-programming/463313-32-bit-clr-procedure-64-bit-sql-server.html Does that mean it's not possible to run a 32 bits
I'm programming a simple client-server application, where the server opens a thread, that watches
I am programming a Tcp server for an XNA game that me and a
I am programming a server daemon from which users can query data in C.
Ruby on Rails has become a new competitive face in the server programming industry,
I am programming a http server. There is the main daemon spawning a bunch
I'm programming a client server app. I'm wondering to end the connection, which side
I'm trying to do some server/socket programming. The server code is written in plain
I'm programming for an Apache server and I need for just one specific html

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.