ClanLib

Warnings and Gotchas of using ClanLib

OUTDATED

Abstract:

This document covers all issues about ClanLib safely and correctly

Creating destroying objects

All objects must both created AND destroyed inside their respective ::init() and ::deinit() groups. This means that letting an object fall out of scope might not work, especially in CL_Application::main().

In this code ses is destroyed when it goes out of scope, which is after it should be destroyed. A better solution to this problem would be either wrap Do_Bar in some other function. eg

The code above is perfectly safe as ses is destroy when Do_Bar goes out of scope which is before deinit(). Another way is to use pointers.

Questions or comments, write to the ClanLib mailing list.