glsl: Change loop_analysis to not look like a resource leak

Previously the loop_state was allocated in the loop_analysis
constructor, but not freed in the (nonexistent) destructor.  Moving
the allocation of the loop_state makes this code appear less sketchy.

Either way, there is no actual leak.  The loop_state is freed by the
single caller of analyze_loop_variables.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Dave Airlie <airlied@freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57753
This commit is contained in:
Ian Romanick
2012-07-10 16:26:33 -07:00
parent 04f0d6cc22
commit 82691f1293
2 changed files with 7 additions and 8 deletions

View File

@@ -249,7 +249,7 @@ private:
void *mem_ctx;
friend class loop_analysis;
friend loop_state *analyze_loop_variables(exec_list *instructions);
};
#endif /* LOOP_ANALYSIS_H */