DirectFB - Home of the pragmatist Roadmap


[directfb-dev] Re: [PATCH] Add IDirectFBDisplayLayer::GetName
Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[directfb-dev] Re: [PATCH] Add IDirectFBDisplayLayer::GetName



Hi,

Ville Syrjälä <syrjala@sci.fi> writes:

> It appears that a layer's name isn't used anywhere. Or maybe I'm blind?
> I was going to use it to identify the Matrox G400 layers since hardcoded
> IDs arent very nice. This patch adds IDirectFBDisplayLayer::GetName.
> Comments?

why don't we make it part of the LayerDescription?

The real problem with names and other string values is that you either
need to copy the string or you expose internal data. If we copy the
name, we can't make it part of the LayerDescription since that would
mean that people would have to free it afterwards. We'd have to go for
IDirectFBDisplayLayer::GetName() then.

Your patch uses the GetName() API but it doesn't copy the
string. Since it does not even mark it as const, people may try to
free it. Since that would lead to some hard-to-debug problems later,
I'd say we should return a copy instead.


Salut, Sven


--
Info:  To unsubscribe send a mail to listar@directfb.org with
"unsubscribe directfb-dev" as subject.



Home | Main Index | Thread Index


directfb.org / Development / Old Archives