| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Current glib minimum is 2.50.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code was based on false assumption that cancelling cancellable of
asynchronous request stops execution of callback handler.
In fact cancelling asynchronous call does not prevent callback from
geting invoked. Moreover handlers for asynchronuos call are only invoked
from thread's main loop. That means if you set property, then free cache
you will have outstanding handler invocations with dangling pointers to
XfconfCacheOldItem and no reliable way of detecting this situation
inside handler. The solution is to only free old_item(s) inside handler
and differentiate processing inside handler based on whether call has
been cancelled (by checking cancellable status).
|
|
|
|
| |
- Fix bug #15135
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
xfconf_cache_set may be called twice before xfconf_cache_set_property_reply_handler, in which case old_item gets freed and the second handler call might cause undefined behavior or a segfault.
Added a counter to prevent that.
Signed-off-by: Ali Abdallah <ali@xfce.org>
|
| |
|
|
|
|
|
| |
GPtrArray is now duplicated and saved in the cache, so the user
can free the return array value.
|
|
|
|
| |
references.
|
|
|
|
|
|
| |
xfconf-gvaluefuncs.c code.
Change XfconfClient to XfconfExported according to the dbus xml file.
|
| |
|
|
|
|
| |
Get rid of the last dbus-glib code in libxfconf.
|
|
|
|
|
|
| |
The XFCONF_TYPE_G_VALUE_ARRAY old dbus-glib type is not used anymore.
Instead the G_TYPE_PTR_ARRAY type is used and then each value of the
array is converted to GVariant before sending over dbus.
|
|
|
|
|
|
|
| |
as follows: xfconf_channel_get_internal is called to get a GValue
which should contain a GVariant that is an array of variants value.
Each of these GVariant value is transformed to a GValue and added
to the GPtrArray.
|
| |
|
|
|
|
| |
GDBusProxy equivalents. All the rest is still based on DBusGProxy.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
In xfconf_cache_set_property_reply_handler() if the item is not found in
cache->properties, the function exit (goto out;) without removing the
old_property from cache->old_properties nor the call from cache->pending_calls.
Then when xfconf_cache_set() is called, the old_item is still found in the hash
(as it wasn't removed previously) and therefore dbus_g_proxy_cancel_call() is
called in a call which was completed, thus leading to the double-free and the
crash.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Since each channel has its own cache, we can avoid updating
values because the hash table contains unique properties and
there are no nodes in the tree yet.
|
| |
|
| |
|
|
|
|
|
| |
Both are not implemented yet, so disable them until
we actually use it.
|
|
|
|
|
|
|
|
|
|
|
| |
None of the Xfce apps opens more then 2 new channels with
the same name, so that means we never return an existing
cache object and use it twice. It also leaked the hash table
for the cache singletons, so optimize for the 'common case'.
2 of the same caches works fine (but doubles the dbus traffic)
so to really fix this an app should use the channel singletons.
Mentioned this in the API docs.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Brian already added a FIXME with the question if we should
wait for pending calls to finish before freeing the items.
Well the question is yes, because the get-tests failed on my
system because the channel was closed in the set-tests before
dbus replied and thus nothing was stored in the test-channel.
So wait for pending calls in finalize and skip the normal reply
handler by setting the hash table in the cache to NULL.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It turned out the object bindings code triggered a bug
in the cache code because it edits multiple properties
with the same name in a short time and then destroying
the channel.
This left a number (6) of pending call keys in one of the
hash tables with the same value resulting in double frees
when destroying the table.
To fix this steal the item from the table when cancelling
the dbus call, then the old_item we insert again is then
not freed and exists only once in the table.
|
|
|
|
|
|
| |
When leaving the reply handler xfconf should only remove
the mutex lock and not free the item since we only looked
it up from the hash table, it's not stolen yet.
|
|
|
|
|
|
| |
Those 2 warnings are always shown when removing an
xfconf property that does not exist. This makes applications
abort that use g_log_set_always_fatal().
|
| |
|
|
|
|
|
|
| |
this is unfortunate, but it's very hard to keep the cache consistent
when doing this async. there are also problems with calls to
xfconf_channel_has_property() right after resetting a property.
|
| |
|
|
|
|
|
|
| |
that's what happens when you copy and paste and don't change the
arguments. also remove the G_SIGNAL_DETAILED flag for property-changed
since we don't really need it for XfconfCache (just for XfconfChannel).
|
|
|
|
|
|
|
|
|
|
|
| |
dbus-glib's GError registration/mapping is crap. instead of doing
something actually useful and mapping the error returned by dbus
(e.g. "org.xfce.Xfconf.Error.PropertyNotFound") back into the
correct GError domain (XFCONF_ERROR) and GError code
(XFCONF_ERROR_PROPERTY_NOT_FOUND), it instead uselessly uses
DBUS_GERROR and DBUS_GERROR_REMOTE_EXCEPTION, and then tacks the
raw error string onto the end of GError::message, "hiding" it
with a NUL byte. useless.
|
|
|
|
| |
... so we can't free it afterwards, obviously
|
|
|
|
|
|
|
|
| |
a client could re-enter the set function when handling the signal
that reverts a property value after an error. if the old_item is
still in one of the hash tables, that could confuse things.
(Old svn revision: 30419)
|
|
XfconfCache is a transparent cache that sits behind XfconfChannel,
and, so far, involves no new API. this moves most of the dbus code
from XfconfChannel to XfconfCache. on creation, XfconfChannel gets
an XfconfCache object for that channel (the cache objects are
per-channel-name singletons, regardless of property_base or whether
or not the XfconfChannel is a singleton).
on creation, XfconfChannel prefetches all properties in the channel.
this might turn out to be a bad idea for large channels.
property setting does not block if the setting is already in the cache.
i may change this in the future to not block at all ever, but that
might make reporting certain kinds of errors impossible. property
resets are completely non-blocking. lookups are non-blocking if
the setting is already in the cache. the cache automatically
updates itself if another application modifies a property.
the cache has hooks to set the maximum age of entries (in seconds)
and the max number of entries to store in the cache. currently
these two are unimplemented, and i'm not sure if there's value to
exposing these in the public API.
(Old svn revision: 30417)
|