g++ バージョンはg++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-50)
私のテストコードは次のとおりです
    #include <iostream>
    using namespace std;
    class Handle{
    public:
            Handle(int *p, int u):_p(p),use(u){}
            ~Handle(){cout << "delete" << endl; delete _p;}
            void display(){cout << "value : " << *_p << ", use : " << use << endl;}
    private:
            int *_p;
            int use;
    };
    int main()
    {
        //Test case one
        {
        int *i = new int(10);
        Handle *h = new Handle(i, 2);
        Handle *h1 = new Handle(i, 100);
        h->display();
        h1->display();
        delete h;
        delete h1;
        //call ~Handle() two times, means free double times, why don't runtime error??
        }
        //Test case two
        {
            int *a = new int(11);
            Handle h2(a, 23);
            Handle h3(a, 33);
            h2.display();
            h3.display();
            //in this case, will double free error
        }
        cout << "ok" << endl;
        return 0;
    }
テスト ケース 1 だけでは、プログラムはエラーなしで実行されますが、テスト 2 を追加すると、このプログラムにはダブル フリー エラーが発生します。このエラーがどのように発生するのかわかりませんか?