return NULL;
}
-extern "C" void CYHandleClient(CYPool &pool, int socket) {
- CYClient *client(new(pool) CYClient(socket));
+extern "C" void CYHandleClient(int socket) {
+ // XXX: this leaks memory... really?
+ CYPool *pool(new CYPool());
+ CYClient *client(new(*pool) CYClient(socket));
_assert(pthread_create(&client->thread_, NULL, &OnClient, client) == 0);
}
sprintf(address.sun_path, "/tmp/.s.cy.%u", pid);
_syscall(connect(socket, reinterpret_cast<sockaddr *>(&address), SUN_LEN(&address)));
-
- // XXX: this leaks memory... really?
- CYHandleClient(*new CYPool(), socket);
+ CYHandleClient(socket);
} catch (const CYException &error) {
CYPool pool;
fprintf(stderr, "%s\n", error.PoolCString(pool));
double CYCastDouble(const char *value, size_t size);
double CYCastDouble(const char *value);
-extern "C" void CYHandleClient(CYPool &pool, int socket);
+extern "C" void CYHandleClient(int socket);
template <typename Type_>
bool CYRecvAll(int socket, Type_ *data, size_t size) {