Skip to content

Commit

Permalink
Don't return a mortal from owl_perlconfig_message2hashref().
Browse files Browse the repository at this point in the history
  • Loading branch information
andersk committed Dec 6, 2008
1 parent ce6721f commit 19bab8e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions perlconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ SV *owl_perlconfig_message2hashref(owl_message *m)
type[0] = toupper(type[0]);
blessas = owl_sprintf("BarnOwl::Message::%s", type);

hr = sv_2mortal(newRV_noinc((SV*)h));
hr = newRV_noinc((SV*)h);
stash = gv_stashpv(blessas,0);
if(!stash) {
owl_function_error("No such class: %s for message type %s", blessas, owl_message_get_type(m));
Expand Down Expand Up @@ -190,7 +190,7 @@ char *owl_perlconfig_call_with_message(char *subname, owl_message *m)

PUSHMARK(SP) ;
msgref = owl_perlconfig_message2hashref(m);
XPUSHs(msgref);
XPUSHs(sv_2mortal(msgref));
PUTBACK ;

count = call_pv(subname, G_SCALAR|G_EVAL|G_KEEPERR);
Expand Down Expand Up @@ -243,7 +243,7 @@ char * owl_perlconfig_message_call_method(owl_message *m, char *method, int argc
SAVETMPS;

PUSHMARK(SP);
XPUSHs(msgref);
XPUSHs(sv_2mortal(msgref));
for(i=0;i<argc;i++) {
XPUSHs(sv_2mortal(newSVpv(argv[i], 0)));
}
Expand Down
4 changes: 3 additions & 1 deletion perlglue.xs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ command(cmd, ...)
SV *
getcurmsg()
CODE:
ST(0) = owl_perlconfig_curmessage2hashref();
RETVAL = owl_perlconfig_curmessage2hashref();
OUTPUT:
RETVAL

int
getnumcols()
Expand Down

0 comments on commit 19bab8e

Please sign in to comment.