Boost logo

Boost Users :

Subject: [Boost-users] Use boost::object_pool can not quit clearly. Am I misusing?
From: 文凯 (wenkai1987_at_[hidden])
Date: 2012-05-07 23:15:38


I use boost::object_pool in my program, but I found some problems, it
can not quit. Below is the code. Don't suggest me use boost::pool. The
boost::pool is no problem, just discuss the boost::object_pool. Could
anybody help me?

#include <iostream>
#include <boost/pool/object_pool.hpp>

int main(void) {
    boost::object_pool<int> p;
    int count = 1000*1000;
    int** pv = new int*[count];

    for (int i = 0; i < count; i++)
            pv[i] = p.construct();
    for (int i = 0; i < count; i++)
            p.destroy(pv[i]);

    delete [] pv;

    return 0;
}
This program can not quit normally. Why?

http://stackoverflow.com/questions/10491649/use-boostobject-pool-can-not-quit-clearly-am-i-misusing

-- 
Cheers & KaiWen

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net