vxi-discuss



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

Problems whith VXI



Hello,
I have got a problem with the implementation of VXI...
When a 'call' arrives, my app start an new workerthread
to process the VXI. All runs fine till I close my ServerApp.
The Debugger prints a lagre list of memoryleaks...
It only happens when my VXIrunTHREAD funktion
runs once. If I comment the VXI lines (marked them red)
no memory problem accours.
Also I don't understand, why the testVXI runs, and my app
not. 

Hope somebody could give me some hints.

Jürgen Bormuth


p.s.: sorry for the long mail


UINT CVXIServerDlg::VXIrunTHREAD(LPVOID pParam)
{
	channel_info_t* chan = (channel_info_t*)pParam;
	VXIInteger val = VXIIntegerCreate(chan->channelNum);
	VXIObjectSetProperty(chan->channel,"channelNum",val);
	
VXIObjectSetProperty(chan->channel,"serviceName",VXIStringCreate("Generic"))
;
	
VXIObjectSetProperty(chan->channel,"telWaitTimeout",VXIFloatCreate(20.0));
	
VXIObjectSetProperty(chan->channel,"args",VXIObjectClone(chan->args));

	//Den Handle auf den ServerThread holen
	CVXIServerDlg* Server = (CVXIServerDlg*)chan->ServerApp;
	int msg = 0;
	VXIresult err = 0;

	if(VXIIntegerValue(VXIObjectGetProperty(chan->args,"LogEnable"))){
		err = VXIfilelogCreateResource(chan->channel);
	}


	err = PlatformCreateResources(chan->channel);
	if(err){
//...
		return VXIresultERROR;
	}

	//OS Resourcen allocieren...
	OSHandle osH = NULL;			//
	err = VXIosCreateResource(chan->channel);
	if (err){
//...
		return VXIresultERROR;
	}

	chan->osi = osH;	// Was soll das??? Warum soll hier NULL
rein???

	chan->state = INCALL;
	msg = 0;
	msg = msg | JBSTATUS;
	msg = msg | chan->channelNum;
	Server->PostMessage(ID_STATUS_CHANGED,msg,chan->state);

	// VXI ERSTELLEN UND STARTEN

	err = VXIjsiInit(&(chan->runtime));
	if (err){
//..
		return VXIresultERROR;
	}

	void* vxi;
	
VXIapiCreate(chan->channel,chan->osi,chan->channelNum,NULL,chan->runtime,&vx
i);
	err = VXIapiRun(vxi,chan->url);

	VXIValue retn = NULL;
	VXIapiGetResult(vxi,&retn);
	//Hier kann das Ergebniss des VXI Aufrufes verwertet werden.

	VXIValueDestroy(retn);

	VXIpromptWait(chan->channel);
	VXItelDisconnect(chan->channel);
	VXIrecEndSession(chan->channel);

	//VXI zerstören
	VXIapiDestroy(vxi);

	err = PlatformDestroyResources(chan->channel);
	err = VXIosDestroyResource(chan->channel);

// Server über terminierung benachrichtigen
	chan->state = STOPPED;
	msg = 0;
	msg = msg | JBSTATUS;
	msg = msg | chan->channelNum;
	Server->PostMessage(ID_STATUS_CHANGED,msg,chan->state);

	
if(VXIIntegerValue(VXIObjectGetProperty(chan->channel,"LogEnable"))){
		err = VXIfilelogDestroyResource(chan->channel);
	}
	return err;
}

>From Debugger:

D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\crtdbg.h(552) : {1994}
normal block at 0x00947B00, 7 bytes long.
 Data: < gelb  > 20 67 65 6C 62 20 00 
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\crtdbg.h(552) : {1974}
normal block at 0x00947B80, 7 bytes long.
 Data: < rot,  > 20 72 6F 74 2C 20 00 
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\crtdbg.h(552) : {1956}
normal block at 0x00946070, 8 bytes long.
 Data: < blau,  > 20 62 6C 61 75 2C 20 00 
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\crtdbg.h(552) : {1918}
normal block at 0x00946410, 8 bytes long.
 Data: <<R   d  > 3C 52 08 12 A0 64 94 00 
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\crtdbg.h(552) : {1917}
normal block at 0x00946450, 24 bytes long.
 Data: <        # t e x > 06 00 00 00 01 00 00 00 23 00 74 00 65 00 78 00 
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\crtdbg.h(552) : {1916}
normal block at 0x009464A0, 4 bytes long.
 Data: <x K > 78 C2 4B 02 
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\crtdbg.h(552) : {1333}
normal block at 0x00944830, 8 bytes long.
 Data: <<R  pH  > 3C 52 08 12 70 48 94 00 
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\crtdbg.h(552) : {1332}
normal block at 0x00944870, 4 bytes long.
 Data: <    > 00 00 00 00 
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\crtdbg.h(552) : {1129}
normal block at 0x00940030, 4 bytes long.
 Data: <$   > 24 E1 06 12 
D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\crtdbg.h(552) : {746}
normal block at 0x024B99D0, 12292 bytes long.
 Data: <                > 00 04 00 00 00 00 00 00 CD CD CD CD CD CD CD CD 
.
.
.
.




This page is maintained by Alan W Black (awb@cs.cmu.edu)
speechinfo.org is hosted on a machine donated by VA Linux Systems
VA Linux Systems