Re: [g-a-devel]leaked objects - basic reference counting tutorial



Michael Meeks wrote:

Hi David,

On Tue, 2002-07-23 at 14:42, David Bolter wrote:

	To release a reference you need to do:

	Accessible_unref (my_ref);

If my call to Accessible_unref reduces the ref count for that object to 0, is it immediately removed from the hash table?


	I'm suspicious of your question; you taking the ref down to 0 means
that you no longer have any pointers to that reference; whether it goes
from the hash table is a matter of cspi policy and internals; perhaps in
future it could cache them and idly freeing them [ or something similar
] - it can certainly be holding references itself [ over event emission
eg. ]. So ... essentially yes if it hits 0 it should be remotely
unreffed and removed from the hash - for now, but don't rely on it.

We are not relying on them :-) I was just curious since when we shut the gok down we do some unref'ing. *If* we successfully reduce our refs to 0 (balance our refs) during shutdown, and then call SPI_exit(), will there be any complaints from the at-spi?

I am currently in the process of scouring for potential places where we are not unref'ing where we should be... (i've caught some and will be doing a put back hopefully today)

Also, I notice some warnings coming out of report_leaked_ref in spi_main.c... any info on what might have caused these two invalid leaked objects? Is it something gok might be responsible for?

here is a dump:
leaked object Open, role push-button
Warning: AT-SPI error: getName: Unknown CORBA exception id: 'IDL:omg.org/CORBA/BAD_OPERATION:1.0' Warning: AT-SPI error: getRoleName: Unknown CORBA exception id: 'IDL:omg.org/CORBA/BAD_OPERATION:1.0'
leaked object <?>, role invalid
leaked object <main>, role menu-bar
leaked object GTK!, role push-button
Warning: AT-SPI error: getName: Unknown CORBA exception id: 'IDL:omg.org/CORBA/BAD_OPERATION:1.0' Warning: AT-SPI error: getRoleName: Unknown CORBA exception id: 'IDL:omg.org/CORBA/BAD_OPERATION:1.0'
leaked object <?>, role invalid
leaked object Quit, role push-button
bye-bye!

cheers,

~~David



Thanks again Michael, for the info, and the patch.


	No problem, thanks for all the great work on gok.

	Regards,

		Michael.







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