Re: [Vala] Question about some wiki content



The decrement inside the IF is permanent? Even if the IF statement
evaluates to false?

public void down () {
        if (--ref_count == 0) {
            delete (void*) this;
        }
    }

Steven N. Oliver


On Wed, Jan 15, 2014 at 12:28 PM, Luca Bruno <lethalman88 gmail com> wrote:

On 15/01/2014 17:50, Steven Oliver wrote:

I'm looking at
https://wiki.gnome.org/Projects/Vala/ReferenceHandling

In the section titled "Memory management for compact classes with
reference
counting" the custom "up" function, as expected, increments the reference
count. The custom "down" function though does not. I would think it
should.

It does decrease the ref_count.
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list



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