[pywin32-checkins] pywin32/win32/src odbc.cpp,1.20.2.11,1.20.2.12
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-12-06 02:17:31
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3465/win32/src Modified Files: Tag: py3k odbc.cpp Log Message: correct previous merge by reinstating PyTmpObject Index: odbc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v retrieving revision 1.20.2.11 retrieving revision 1.20.2.12 diff -C2 -d -r1.20.2.11 -r1.20.2.12 *** odbc.cpp 4 Dec 2008 00:06:02 -0000 1.20.2.11 --- odbc.cpp 6 Dec 2008 01:47:36 -0000 1.20.2.12 *************** *** 846,849 **** --- 846,867 ---- } + // Class to hold a temporary reference that decrements itself + class TmpPyObject + { + public: + PyObject *tmp; + TmpPyObject() { tmp=NULL; } + TmpPyObject(PyObject *ob) { tmp=ob; } + PyObject * operator= (PyObject *ob){ + Py_XDECREF(tmp); + tmp=ob; + return tmp; + } + + boolean operator== (PyObject *ob) { return tmp==ob; } + operator PyObject *() { return tmp; } + ~TmpPyObject() { Py_XDECREF(tmp); } + }; + static int ibindDate(cursorObject*cur, int column, PyObject *item) { |