mirror of
https://github.com/rive-app/rive-ios.git
synced 2026-01-18 17:11:28 +01:00
Added destructors for render path and render paint
This commit is contained in:
@@ -17,7 +17,7 @@ struct ContentView: View {
|
||||
|
||||
struct MyRive: UIViewControllerRepresentable {
|
||||
func makeUIViewController(context: Context) -> RiveViewController {
|
||||
return RiveViewController(resource: "bird", withExtension: "riv")
|
||||
return RiveViewController(resource: "truck", withExtension: "riv")
|
||||
}
|
||||
|
||||
func updateUIViewController(_ uiViewController: RiveViewController, context: Context) {}
|
||||
|
||||
@@ -88,8 +88,8 @@ namespace rive
|
||||
std::vector<CGFloat> colorStops;
|
||||
std::vector<CGFloat> stops;
|
||||
|
||||
|
||||
RiveRenderPaint();
|
||||
~RiveRenderPaint();
|
||||
|
||||
void color(unsigned int value) override;
|
||||
void style(RenderPaintStyle value) override;
|
||||
@@ -131,6 +131,8 @@ namespace rive
|
||||
|
||||
public:
|
||||
RiveRenderPath();
|
||||
~RiveRenderPath();
|
||||
|
||||
CGMutablePathRef getPath() { return path; }
|
||||
FillRule getFillRule() { return m_FillRule; }
|
||||
|
||||
|
||||
@@ -32,6 +32,12 @@ RiveRenderPaint::RiveRenderPaint() {
|
||||
// NSLog(@"INITIALIZING A NEW RENDER PAINT");
|
||||
}
|
||||
|
||||
RiveRenderPaint::~RiveRenderPaint() {
|
||||
NSLog(@"Releasing paint resources");
|
||||
CGColorRelease(cgColor);
|
||||
CGGradientRelease(gradient);
|
||||
}
|
||||
|
||||
void RiveRenderPaint::style(RenderPaintStyle value) {
|
||||
// NSLog(@" --- RenderPaint::style");
|
||||
switch(value) {
|
||||
@@ -195,6 +201,11 @@ RiveRenderPath::RiveRenderPath() {
|
||||
path = CGPathCreateMutable();
|
||||
}
|
||||
|
||||
RiveRenderPath::~RiveRenderPath() {
|
||||
NSLog(@"Releasing path resources");
|
||||
CGPathRelease(path);
|
||||
}
|
||||
|
||||
void RiveRenderPath::close() {
|
||||
// NSLog(@" --- RenderPath::close");
|
||||
CGPathCloseSubpath(path);
|
||||
|
||||
Reference in New Issue
Block a user