Re: inline + Gtk+-2.0 hack (crashing)



Hi Goran

I spent a little time getting up to speed with your hack as
I am quite keen to see PerlGtk2.0 advance.

I think that you don't want to call sv_2mortal in the XPUSHs
as this implies a reference decrement at the FREETMPS

I took that out and mine doesn't crash.....

Shane.

static void
perl_closure_marshal(GClosure *closure,
                     GValue *return_value,
                     guint n_param_values,
                     const GValue *param_values,
                     gpointer invocation_hint,
                     gpointer marshal_data)
{
    perlClosure *pc = (perlClosure *)closure;
    guint i;
fprintf(stderr,"Marshalling: func: %lx (refcnt: %d) data: %lx (refcnt: %d)\n",
            pc->callback, pc->callback->sv_refcnt,
pc->extra_args, pc->extra_args ? pc->extra_args->sv_refcnt : 0);
    // g_assert(pc->extra_args);
    if (pc->extra_args)
      {
        g_assert(!G_IS_OBJECT(pc->extra_args));
      }
    {
        dSP;
        ENTER;
        SAVETMPS;
        PUSHMARK(SP);
        XPUSHs(pc->extra_args ? pc->extra_args : &PL_sv_undef);
        PUTBACK ;
        perl_call_sv(pc->callback, G_DISCARD);
        SPAGAIN;
        PUTBACK;
        FREETMPS;
        LEAVE;
    }
    // fprintf(stderr,"Marshalling2...\n");
}




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