Comment on attachment 726580 Implement a replacement of atk_object_set_name() which mimics the behavior without calling atk_object_get_name()
>+static void >+AtkObjectSetName(AtkObject *aAtkObj, const gchar *name) so, both of the times this is called we have to check if we actually want to fire an event first. So why don't we refactor this stuff like this make this function static void MaybeFireNameChange(AtkObject* aObj, nsString& aNewName) then it can incapsilate the stuff about comparing against the old name. >+ size_t name_len = strlen(name); >+ >+ if (strlen(aAtkObj->name) >= name_len) { >+ /* If the new name is shorter, then just use the old memory chunk >+ * to minimize memory fragmentation. */ >+ memcpy(aAtkObj->name, name, name_len + 1); >+ } else { >+ g_free(aAtkObj->name); >+ aAtkObj->name = g_strdup(name); I'd be suprised if this isn't a win and possibly a loss. Especially since the best you can do is strlen while the allocator actually knows how big the block is. otherwise this seems like the correct approach so f=me but I'd like to see another version before r+ :) -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to firefox in Ubuntu. https://bugs.launchpad.net/bugs/948788 Title: thunderbird crashed on launch Status in The Mozilla Firefox Browser: In Progress Status in “atk1.0” package in Ubuntu: Fix Released Status in “firefox” package in Ubuntu: Fix Released Status in “atk1.0” source package in Precise: Fix Released Status in “firefox” source package in Precise: Fix Released Bug description: Lauching thunderbird directly results in a core-dump ProblemType: Bug DistroRelease: Ubuntu 12.04 Package: thunderbird 11.0~b4+build1-0ubuntu1 ProcVersionSignature: Ubuntu 3.2.0-18.28-generic 3.2.9 Uname: Linux 3.2.0-18-generic x86_64 AddonCompatCheckDisabled: False AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24. ApportVersion: 1.94-0ubuntu2 Architecture: amd64 ArecordDevices: **** List of CAPTURE Hardware Devices **** card 0: Intel [HDA Intel], device 0: CONEXANT Analog [CONEXANT Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 AudioDevicesInUse: USER PID ACCESS COMMAND /dev/snd/controlC0: nbarcet 2605 F.... pulseaudio BuildID: 20120302135656 CRDA: Error: [Errno 2] No such file or directory Card0.Amixer.info: Card hw:0 'Intel'/'HDA Intel at 0xf2620000 irq 45' Mixer name : 'Intel IbexPeak HDMI' Components : 'HDA:14f15069,17aa214c,00100302 HDA:80862804,17aa21b5,00100000' Controls : 27 Simple ctrls : 9 Card29.Amixer.info: Card hw:29 'ThinkPadEC'/'ThinkPad Console Audio Control at EC reg 0x30, fw 6IHT39WW-1.14' Mixer name : 'ThinkPad EC 6IHT39WW-1.14' Components : '' Controls : 1 Simple ctrls : 1 Card29.Amixer.values: Simple mixer control 'Console',0 Capabilities: pswitch pswitch-joined penum Playback channels: Mono Mono: Playback [on] Channel: beta Date: Wed Mar 7 09:51:39 2012 EcryptfsInUse: Yes ForcedLayersAccel: False IncompatibleExtensions: EDS Contact Integration - ID=edsintegrat...@mozilla.com, Version=0.3.9, minVersion=7.0, maxVersion=11.0a1, Location=app-global, Type=extension, Active=Yes Dictionnaire français «Classique & Réforme 1990» - ID=fr-classique-reforme1...@dictionaries.addons.mozilla.org, Version=4.3, minVersion=5.0, maxVersion=10.*, Location=app-profile, Type=extension, Active=Yes Auto Select Latest Message (restartless) - ID=autoselectlatestmessage@vano, Version=1.0, minVersion=3.3a1pre, maxVersion=10.*, Location=app-profile, Type=extension, Active=Yes Quicktext - ID={8845E3B3-E8FB-40E2-95E9-EC40294818C4}, Version=0.9.11.1, minVersion=5.0b2pre, maxVersion=10.*, Location=app-profile, Type=extension, Active=Yes Google Contacts - ID={BDD92442-0534-4D6F-A966-BAB7D561D781}, Version=0.6.40, minVersion=3.1, maxVersion=10.*, Location=app-profile, Type=extension, Active=Yes InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120201.2) ProcEnviron: LANGUAGE=en_US:en TERM=xterm PATH=(custom, user) LANG=en_US.UTF-8 SHELL=/bin/bash Profiles: Profile0 (Default) - LastVersion=11.0/20120302135656 RunningIncompatibleAddons: True SourcePackage: thunderbird UpgradeStatus: Upgraded to precise on 2012-02-16 (19 days ago) dmi.bios.date: 02/01/2011 dmi.bios.vendor: LENOVO dmi.bios.version: 6IET75WW (1.35 ) dmi.board.name: 2516CTO dmi.board.vendor: LENOVO dmi.board.version: Not Available dmi.chassis.asset.tag: No Asset Information dmi.chassis.type: 10 dmi.chassis.vendor: LENOVO dmi.chassis.version: Not Available dmi.modalias: dmi:bvnLENOVO:bvr6IET75WW(1.35):bd02/01/2011:svnLENOVO:pn2516CTO:pvrThinkPadT410:rvnLENOVO:rn2516CTO:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable: dmi.product.name: 2516CTO dmi.product.version: ThinkPad T410 dmi.sys.vendor: LENOVO To manage notifications about this bug go to: https://bugs.launchpad.net/firefox/+bug/948788/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp