[Webkit-unassigned] [Bug 19939] [GTK] webkit_web_history_item_get_title() fails with assertion
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Aug 6 21:40:51 PDT 2008
https://bugs.webkit.org/show_bug.cgi?id=19939
------- Comment #4 from alp at nuanti.com 2008-08-06 21:40 PDT -------
(In reply to comment #3)
> (In reply to comment #2)
> > Created an attachment (id=22656)
--> (https://bugs.webkit.org/attachment.cgi?id=22656&action=view) [edit]
> > Fix history management
> >
> > This patch fixes recently introduced regressions in WebHistory. Candidate for
> > backporting to 1.0.1.
> >
>
> @@ -257,9 +255,14 @@ WebKitWebHistoryItem* webkit_web_history
> {
> WebKitWebHistoryItem* webHistoryItem = kit(item);
>
> - if (!webHistoryItem) {
> + if (webHistoryItem)
> + g_object_ref(webHistoryItem);
> + else {
>
> I don't think increasing the ref count is necessary here. The backforwardlist
> already does that when it uses this function and there's no way to unref the
> webHistoryItem when you do it here.
>
> Looks good otherwise.
>
I did this simply to balance object reference counts, since the other code path
creates a new instance:
{
WebKitWebHistoryItem* webHistoryItem = kit(item);
- if (!webHistoryItem) {
+ if (webHistoryItem)
+ g_object_ref(webHistoryItem);
+ else {
webHistoryItem =
WEBKIT_WEB_HISTORY_ITEM(g_object_new(WEBKIT_TYPE_WEB_HISTORY_ITEM, NULL));
- webkit_history_item_add(webHistoryItem, core(webHistoryItem));
+ WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
+
+ priv->historyItem = item;
+ webkit_history_item_add(webHistoryItem, priv->historyItem.get());
}
This probably doesn't solve memory management issues here but at least it's
consistent this way.
Bug #19898 might solve memory issues more fully but I wanted to get the crasher
fix in soonish. I'm happy to get this one in with or without the ref change to
get things usable.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list