Fix access to unallocated memory in IAsyncPG
IAsyncPG was deleting its self, then returning an instance variable
by value. This is probably going to be safe pretty much all the time,
but it's still a memory error, and DrMemory (a Windows valgrind-alike)
complains about it:
Error #4: UNADDRESSABLE ACCESS: reading 0x00b1b2b0-0x00b1b2b4 4 byte(s)
# 0 pgenlista.dll!IAsyncPG::Release [c:\users\administrator\desktop\psqlodbc\msdtc_enlist.cpp:352]
# 1 pgenlista.dll!CloseCommitThread [c:\users\administrator\desktop\psqlodbc\msdtc_enlist.cpp:971]
# 2 MSVCR120D.dll!_callthreadstart [f:\dd\vctools\crt\crtw32\startup\thread.c:255]
# 3 MSVCR120D.dll!_threadstart [f:\dd\vctools\crt\crtw32\startup\thread.c:237]
# 4 KERNEL32.dll!BaseThreadInitThunk +0x11 (0x7768338a <KERNEL32.dll+0x1338a>)
Note: @0:00:57.879 in thread 4516
Note: next higher malloc: 0x00b1b420-0x00b1b440
Note: 0x00b1b2b0-0x00b1b2b4 overlaps memory 0x00b1b2a0-0x00b1b390 that was freed here:
Note: # 0 replace_operator_delete [d:\drmemory_package\common\alloc_replace.c:2524]
Note: # 1 pgenlista.dll!IAsyncPG::`scalar deleting destructor'
Note: # 2 pgenlista.dll!IAsyncPG::Release [c:\users\administrator\desktop\psqlodbc\msdtc_enlist.cpp:341]
Note: # 3 pgenlista.dll!CloseCommitThread [c:\users\administrator\desktop\psqlodbc\msdtc_enlist.cpp:971]
Note: # 4 MSVCR120D.dll!_callthreadstart [f:\dd\vctools\crt\crtw32\startup\thread.c:255]
Note: # 5 MSVCR120D.dll!_threadstart [f:\dd\vctools\crt\crtw32\startup\thread.c:237]
Note: # 6 KERNEL32.dll!BaseThreadInitThunk +0x11 (0x7768338a <KERNEL32.dll+0x1338a>)
Note: instruction: mov 0x10(%eax) -> %eax
This patch fixes the issue.