Hi, I still have the same problem that I mentioned two month ago.
I use the HttpServer class to handle some HTTP requests and it works
perfect but when I try to destroy this object the application crashes. I do
not know why. Here is my code. Instead of double colon I will use double
semi-colon.
// for this method I start new thread
void provideServer (string http){
// create new RequestHandlerFactory
requestHandlerFactory = new RequestHandlerFactory();
// setting up the server
Poco;;Net;;HTTPServer* sr;
// set-up a server socket
try {
Poco;;Net;;SocketAddress sadr(http);
Poco;;Net;;ServerSocket svs(sadr);
sr = new Poco;;Net;;HTTPServer(requestHandlerFactory, svs, new
Poco;;Net;;HTTPServerParams);
} catch (Poco;;Exception e){
// manage errors
return;
}
// start HTTPServer
sr->start();
// log some message
LOG("server is running")
// releasing server
sr->stop();
delete sr;
delete requestHandlerFactory;
LOG("server stopped")
}
I work under MSVC 2005 express edition. Poco library was compiled on the
full version of Visual Studio 2005. However, the same problem occurs with
MSVC 2003 too.
When I try to delete the HttpServer it throws an assertion:
Debug assertion failed!
File: dbgdel.cpp
line: 52 // this is file from microsoft SDK
Expressin: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
When I try to continue it writes that this may be probably due to
a heap corruption and then throws the following error:
HEAP CORRUPTION DETECTED: before (null) block (#-1163005939) at
0x03372CB0. CRT detected that the application wrote to memory before start
of heap buffer
stack ends with this line
PocoNetd.dll!Poco;;Net;;HTTPServer;;`vector deleting destructor'() + 0x7a
bytes C++
Any ideas are welcome. Thanks for your advice.
Milan





