|
|
Sponsor |
Re: dbus_connection_send_with_reply_and_block and errors: msg#00057freedesktop.dbus
On Tue, 2005-08-09 at 19:55 +0300, Timo Teräs wrote: > ext Havoc Pennington wrote: > > On Tue, 2005-08-09 at 19:02 +0300, Timo Teräs wrote: > >>dbus_set_error() never duplicates the error.name field; it just does a > >>pointer assignment. > > > > I think this is the bug (I'm not sure why it is like this to be honest, > > seems like a pretty bad idea, though it looks like it was deliberate) > > I guess in most cases the error.name is a constant and can be safely > assigned. This makes sense since it saves memory and CPU cycles. But in case > of dbus_set_error_from_message() it is just broken. > > So, shall I write a patch to do duplication of .name in dbus_set_error() and > do a free() in dbus_error_free()? Hm...doesn't this make OOM handling significantly more complicated if setting an error can require memory allocation? Perhaps instead of the reference counting (which sounds complicated) we could simply to add a "dbus_bool_t free_name" member; dbus_set_error_from_message sets this (and dups the name), and dbus_error_free frees the name if it's set. Wouldn't that work?
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: dbus_connection_send_with_reply_and_block and errors, Timo Teräs |
|---|---|
| Next by Date: | Re: dbus_connection_send_with_reply_and_block and errors, Timo Teräs |
| Previous by Thread: | Re: dbus_connection_send_with_reply_and_block and errors, Timo Teräs |
| Next by Thread: | Re: dbus_connection_send_with_reply_and_block and errors, Timo Teräs |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home | sitemap
| advertise | OSDir is
an inevitable website.
|