- .. note:: Do note that as soon as we tear down this object, all underlying
- derived objects such as queries, threads, messages, tags etc will
- be freed by the underlying library as well. Accessing these objects
- will lead to segfaults and other unexpected behavior.
-
- We implement reference counting, so that parent objects can be
- automatically freed when they are not needed anymore, for example::
-
- db = Database('path',create=True)
- msgs = Query(db,'from:myself').search_messages()
-
- This returns a :class:`Messages` which internally contains
- a reference to the parent :class:`Query` object. Otherwise
- the Query() would be immediately freed, taking our *msgs*
- down with it.
-
- In this case, the above Query() object will be
- automatically freed whenever we delete all derived objects,
- ie in our case: `del (msgs)` would also delete the parent
- Query (but not the parent Database() as that is still
- referenced from the variable *db* in which it is stored.
-
- Pretty much the same is valid for all other objects in the hierarchy,
- such as :class:`Query`, :class:`Messages`, :class:`Message`,
- and :class:`Tags`.
+ .. note:: Do remember that as soon as we tear down this object,
+ all underlying derived objects such as queries, threads,
+ messages, tags etc will be freed by the underlying library
+ as well. Accessing these objects will lead to segfaults and
+ other unexpected behavior. See above for more details.