HerbertKoelman / cpp-atmi

Application-to-Transaction Monitor Interface (ATMI) C++ library
http://herbertkoelman.github.com/cpp-atmi
Other
7 stars 0 forks source link

Class Buffer frees buffers that were not allocated by Buffer instance #38

Closed HerbertKoelman closed 11 years ago

HerbertKoelman commented 11 years ago

When setting a buffer into an instance of class Buffer previous referenced buffer is freed. Even if this buffer was not allocated by the instance.

To avoid this, class Buffer could be extended into TuxedoBuffer and FmlBuffer class. These classes are extending the Buffer class with memory management functions that are either FML memory handling functions or Tuxedo memory handling functions (tpalloc and tpfree).

HerbertKoelman commented 11 years ago

Define a flag allocated instead of define two extended classes.