summaryrefslogtreecommitdiff
path: root/src/smi_output.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@gmail.com>2008-12-21 16:02:57 +0100
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-12-21 18:50:59 -0200
commit068de9c0a302aba21e4d6a27eb6d330375ff2d2f (patch)
tree4475b33593ef230682888ff6fc38ff637d282e31 /src/smi_output.c
parent373440667636d4e3214028710e33ac89d8f18ff1 (diff)
Allocate crtc->funcs and output->funcs in the heap.
Diffstat (limited to 'src/smi_output.c')
-rw-r--r--src/smi_output.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/smi_output.c b/src/smi_output.c
index 5ddbcc8..bbc3f5c 100644
--- a/src/smi_output.c
+++ b/src/smi_output.c
@@ -151,30 +151,29 @@ SMI_OutputGetModes_native(xf86OutputPtr output)
#endif
}
-
-
static void
SMI_OutputDestroy(xf86OutputPtr output)
{
ENTER();
- /* Nothing */
+ xfree(output->funcs);
LEAVE();
}
void
-SMI_OutputFuncsInit_base(xf86OutputFuncsPtr outputFuncs)
+SMI_OutputFuncsInit_base(xf86OutputFuncsPtr* outputFuncs)
{
- memset(outputFuncs,0,sizeof(outputFuncs));
- outputFuncs->create_resources = SMI_OutputCreateResources;
- outputFuncs->mode_valid = SMI_OutputModeValid;
- outputFuncs->mode_fixup = SMI_OutputModeFixup;
- outputFuncs->prepare = SMI_OutputPrepare;
- outputFuncs->commit = SMI_OutputCommit;
- outputFuncs->mode_set = SMI_OutputModeSet;
- outputFuncs->detect = SMI_OutputDetect;
- outputFuncs->destroy = SMI_OutputDestroy;
+ *outputFuncs = xnfcalloc(sizeof(xf86OutputFuncsRec), 1);
+
+ (*outputFuncs)->create_resources = SMI_OutputCreateResources;
+ (*outputFuncs)->mode_valid = SMI_OutputModeValid;
+ (*outputFuncs)->mode_fixup = SMI_OutputModeFixup;
+ (*outputFuncs)->prepare = SMI_OutputPrepare;
+ (*outputFuncs)->commit = SMI_OutputCommit;
+ (*outputFuncs)->mode_set = SMI_OutputModeSet;
+ (*outputFuncs)->detect = SMI_OutputDetect;
+ (*outputFuncs)->destroy = SMI_OutputDestroy;
}
Bool