Changeset 71


Ignore:
Timestamp:
Jul 20, 2009 4:25:09 PM (13 years ago)
Author:
hammonds
Message:

Fix some typing issues
Fix memory leaks in the callbacks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • caPython/branches/newPointers/ca_internal_functions.c

    r39 r71  
    258258                break;
    259259            case DBR_CHAR:
    260                 d = Py_BuildValue("b",  (int)pBuf->charval);
     260                d = Py_BuildValue("b",  (char)pBuf->charval);
    261261                break;
    262262            /* case DBR_SHORT: = DBR_INT */
     
    286286                /* case DBR_STRING: No arrays of strings in EPICS*/
    287287                case DBR_CHAR:
    288                     pyVal = Py_BuildValue("b", (int)*(&(pBuf->charval) + i));
     288                    pyVal = Py_BuildValue("b", (char)*(&(pBuf->charval) + i));
    289289                    break;
    290290                /* case DBR_SHORT: = DBR_INT */
     
    309309        /*d = Py_BuildValue("{s:O}", PV_VALUE, t);*/
    310310        d = t;
    311 /*      Py_XDECREF(t); */ /* dictionary now references the tuple */
     311        /*Py_XINCREF(d);
     312        Py_XDECREF(t);*/  /* dictionary now references the tuple */
     313          /*Py_XDECREF(pyVal);*/
    312314    } /* end else */
    313315    return d;
     
    11151117            s = unpackPlainGet(pBuf, event_args.type, event_args.count);
    11161118            d = Py_BuildValue( "{s:O}", PV_VALUE, s);
     1119            Py_XDECREF(s);
    11171120        }
    11181121        else if(dbr_type_is_STS(event_args.type)) {
     
    11861189            s = unpackPlainGet(pBuf, event_args.type, event_args.count);
    11871190            d = Py_BuildValue( "{s:O}", PV_VALUE, s);
     1191            Py_XDECREF(s);
    11881192        }
    11891193        else if(dbr_type_is_STS(event_args.type)) {
     
    12031207    }
    12041208
    1205     /* Create a swigged pointer to the channel identifier */
     1209          /* Create a swigged pointer to the channel identifier */
    12061210    chidptr = SWIG_NewPointerObj((chid *) &(event_args.chid),
    12071211    SWIGTYPE_p_chid, 0);
Note: See TracChangeset for help on using the changeset viewer.