GNOME Bugzilla – Bug 666480
[REGRESSION] Vala from git - virtual method in interface tries to access the self->priv
Last modified: 2012-01-17 09:08:58 UTC
Created attachment 203825 [details] mapiterator.vala mapiterator.vala from current git master compiles on Vala 0.14 but not current git master: CC libgee_0_8_la-mapiterator.lo mapiterator.c: In function ‘gee_map_iterator_real_fold’: mapiterator.c:178:29: error: dereferencing pointer to incomplete type mapiterator.c:178:86: error: dereferencing pointer to incomplete type mapiterator.c:179:29: error: dereferencing pointer to incomplete type mapiterator.c:179:86: error: dereferencing pointer to incomplete type mapiterator.c:206:30: error: dereferencing pointer to incomplete type mapiterator.c:206:88: error: dereferencing pointer to incomplete type mapiterator.c:207:30: error: dereferencing pointer to incomplete type mapiterator.c:207:88: error: dereferencing pointer to incomplete type mapiterator.c: In function ‘gee_map_iterator_real_foreach’: mapiterator.c:248:29: error: dereferencing pointer to incomplete type mapiterator.c:248:86: error: dereferencing pointer to incomplete type mapiterator.c:249:29: error: dereferencing pointer to incomplete type mapiterator.c:249:86: error: dereferencing pointer to incomplete type mapiterator.c:270:30: error: dereferencing pointer to incomplete type mapiterator.c:270:88: error: dereferencing pointer to incomplete type mapiterator.c:271:30: error: dereferencing pointer to incomplete type mapiterator.c:271:88: error: dereferencing pointer to incomplete type
Created attachment 203826 [details] mapiterator.c (from 0.14)
Created attachment 203827 [details] mapiterator.c (from git)
Created attachment 203828 [details] mapiterator.c (from git) Ups. Incorrect file
That's because get_key() and get_value() return an owned value. I believe the old code leaked.
(In reply to comment #4) > That's because get_key() and get_value() return an owned value. I believe the > old code leaked. Yes. However the same problem affects fold in Traversable which does not have this problem: public virtual A fold<A> (FoldFunc<A, G> f, owned A seed) { this.foreach ((item) => {seed = f ((owned) item, (owned) seed);}); return (owned) seed; } (C code: (...) _tmp1_ = item; item = NULL; (...) _tmp3_ = _tmp0_ (_tmp1_, _tmp2_, _tmp0__target); (...) ((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL)); )
(In reply to comment #5) > (In reply to comment #4) > > That's because get_key() and get_value() return an owned value. I believe the > > old code leaked. > > Yes. However the same problem affects fold in Traversable which does not have > this problem: It does, "item" is owned.
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > That's because get_key() and get_value() return an owned value. I believe the > > > old code leaked. > > > > Yes. However the same problem affects fold in Traversable which does not have > > this problem: > > It does, "item" is owned. I mean that it does not have memory leak yet it produces non-compiling code.
*** This bug has been marked as a duplicate of bug 589968 ***
Created attachment 205427 [details] [review] Reintroduce memory leak when using generics in interfaces The bug was present in older Vala versions. Reintroducing it avoids breaking old code, until a proper fix is found. Does the patch addresses your problem?