Document wxGridTable::GetValueAsCustom() return value constraint

The returned pointer must be allocated on the heap as
wxGridCellDateTimeRenderer::GetString() currently deletes it.

This seems like a rather poor idea, as any internally stored values must
be cloned on each call, but it seems too dangerous to change this as it
could result in massive memory leaks in the existing code.
This commit is contained in:
Vadim Zeitlin
2018-09-11 01:38:39 +02:00
parent df87960bfc
commit 4fd80960ca

View File

@@ -1633,6 +1633,11 @@ public:
This should only be called if CanGetValueAs() returns @true when called
with @a typeName. Default implementation always return @NULL.
Note that if the pointer is not null, it will be deleted by the caller,
so it must be allocated on the heap by any class overriding this
method. In practice, it means that the value stored internally must be
cloned on every call.
*/
virtual void *GetValueAsCustom(int row, int col, const wxString& typeName);