Re: [Vala] Custom array free functions



On Tue, Apr 26, 2011 at 02:58:23AM -0700, Jon Rosebaugh wrote:
Surely this is a violation of encapsulation? If a library provides
some structure in memory and says to free it with function foo(), then
even if foo() is the same thing as free() RIGHT NOW, that doesn't mean
it's a good idea to instead use function bar() which also happens to
be free() RIGHT NOW. Either foo or bar might change in the future, or
under some circumstances which you don't expect.

We're talking about arrays, what you say already works like that for objects.
Again, if you really want to use XFree() in this case, just use pointers
instead of arrays and call XFree() manually.

-- 
http://www.debian.org - The Universal Operating System

Attachment: signature.asc
Description: Digital signature



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