Re: [Tracker] Fwd: Tracker closing the databse



On 15/07/13 09:25, Putinei .Ionut wrote:
Think i have replied only to Martin.

Forgive me Putinei, I thought you replied to the list.

Comments below...

---------- Forwarded message ----------
From: *Putinei .Ionut* <putineiionut gmail com
<mailto:putineiionut gmail com>>
Date: Fri, Jul 5, 2013 at 10:06 AM
Subject: Re: [Tracker] Tracker closing the databse
To: Martyn Russell <martyn lanedo com <mailto:martyn lanedo com>>


The TrackerSparqlConnection is left open since is a class member and is
closed in destructor.
TrackerSparqlCursor is unrefed.

Here i am about to execute a banch of queries.....but i am not
interested in results....i am only interested if query has any results
bool TestClass::ExecuteBatchQuery(std::vector<std::string>
&queries,std::vector<bool>* queryResponseCount){
     TrackerSparqlConnection *trackerConnection =
getTrackerConnection(); // here we get the connection and we assign it
to a class member...further calls to this will return the class member

What does this getTrackerConnection() function actually do?
Can you share the source.

There is already a tracker_sparql_connection_get() API, so I wonder why you have a function here.

     if (trackerConnection == NULL) {
         return false;
     }
     for (int i=0;i<queries.size();++i){

         GError* error = NULL;
         TrackerSparqlCursor* cursor =
tracker_sparql_connection_query(trackerConnection, queries.at
<http://queries.at>(i).c_str(), NULL, &error);
         if (error) {
             queryResponseCount->push_back(false);
             g_error_free (error);
             continue;
         }

         if (cursor == NULL) {
             queryResponseCount->push_back(false);
             continue;
         } else {
             int cursorcount=0;
             while (tracker_sparql_cursor_next(cursor, NULL, &error)) {
                 if (error)
                     break;
                 cursorcount++;
                 break;
             }

             if(cursorcount)
                 queryResponseCount->push_back(true);
             else
                 queryResponseCount->push_back(false);


         g_object_unref(cursor);

Not sure what your push_back() function does, but assuming it doesn't reference anything, it looks like the connection is the only thing not unreferenced.

What version of Tracker are you using?
Have you patched Tracker at all?

--
Regards,
Martyn

Founder and CEO of Lanedo GmbH.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]