diff --git a/webactivity.py b/webactivity.py
index d33913f..c4999ec 100644
a
|
b
|
class WebActivity(activity.Activity): |
155 | 155 | _logger.debug('Starting the web activity') |
156 | 156 | |
157 | 157 | session = WebKit.get_default_session() |
| 158 | |
| 159 | # Reference the object, so that unrefing it later won't destroy it |
| 160 | # Yes, we are deliberately leaking it, because otherwise |
| 161 | # it would be destroyed *after* the python interpreter is finalized. |
| 162 | # And that would result in a crash. See also: |
| 163 | # https://bugzilla.gnome.org/show_bug.cgi?id=678046 |
| 164 | # http://bugs.sugarlabs.org/ticket/3670 |
| 165 | import ctypes |
| 166 | import ctypes.util |
| 167 | glib = ctypes.CDLL(ctypes.util.find_library('gobject-2.0')) |
| 168 | # Note: the hash() of a GObject is its position in memory. |
| 169 | glib.g_object_ref(ctypes.c_void_p(hash(session))) |
| 170 | |
158 | 171 | session.set_property('accept-language-auto', True) |
159 | 172 | |
160 | 173 | # By default, cookies are not stored persistently, we have to |