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


Ville Syrjälä <> 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 with
"unsubscribe directfb-dev" as subject.

Home | Main Index | Thread Index / Development / Old Archives