Basic question refPtr



Hi

perhaps a newbie question about the refPtr

I'm my app I have a refptr declared as private member of a class

example snippet

class nothing {

public: nothing();

private:
    Glib::RefPtr<Gdk::Bitmap>nosense;

     void makeSense();
}

nothing::nothing() {

    // init the refptr
    nosense = Gdk::Bitmap::create(window, data, width, height);
}

nothing::makeSense() {
    nosense = Gdk::Bitmap::create(window, data, width, height);
}

What I'm doing basically is take a Glib::RefPtr declared in the class and initialized in the CTOR. Later in one of the methods (nosense) I reinit the refptr. I want to know if memory allocated in the first init will be destroyed by the second init or do I have to take care for it myself and how?

Thanks

Kees Kling




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]