[postgis-devel] [wktraster] Deallocating memory (rt_band_destroy)

Jorge Arévalo jorge.arevalo at gmail.com
Thu Jan 14 09:04:06 PST 2010


Hello,

rt_band_destroy function simply deallocates memory for band struct,
because the memory for band->data is externally owned. But in
rt_band_from_wkb, for example, memory is allocated for data, and
should be deallocated.

Looking at the code, I think the field "ownsData" of rt_band_t struct
informs about that, but I'm not sure. So, if I'm not wrong:

- ownsData = 0 ==> band->data is externally owned, and it mustn't be deallocated
- ownsData = 1 ==> band->data is internally owned and it must be deallocated

 In this last case, the memory for data should be deallocated when
destroying band in rt_band_destroy. Am I right?

Best regards,
Jorge



More information about the postgis-devel mailing list