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

Re: callback pointer problem solved



As the well known Gernot Kerschbaumer said...
->just after i posted my question, i found the solution to the pointer
->problem: i have to declare the callback function as static then the
->arguments are passed correctly. sorry for causing overheads...

	Then you have Luck... Since declaring a function
	with static does not modify it's own code, your problem
	should not be modified, but your are lucky (not so, in
	fact, because the bug should reappear, causing some 
	serious segfaults).

	Since you get a pointer in your callback, it is important
	to see wether the scope of the pointer is good or not. If
	your 'key' var is defined as static in your setup function
	it would be ok (since it will allways be there). The same
	can be achieved by declaring key as a global var.

	Your program seems to present some classic symptoms. The
	key var is locally defined in your setup function, and the
	scope of this var is your setup func only (idem for any
	pointer to this var) [please, tell me if this is not true,
	but I believe it is :)].

	Regards,

->
->gernot
->-- 
->DI Kerschbaumer Gernot
->Software Development
->FREQUENTIS
->A-1120 Wien, Spittelbreitengasse 34
->gkerschb@frequentis.com

-- 
__________________________________________________________________________
   Emmanuel DELOGET [pixel] pixel@{dotcom.fr,epita.fr}  ----  DotCom SA
         http://www.epita.fr/~pixel | http://www.dotcom.fr/~pixel
"On the last day, God created Linux. And Microsoft won its antitrust case"
--------------------------------------------------------------------------



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