1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
diff -Naur osgearth-osgearth-2.8-orig/src/osgEarthSymbology/GEOS osgearth-osgearth-2.8/src/osgEarthSymbology/GEOS
--- osgearth-osgearth-2.8-orig/src/osgEarthSymbology/GEOS 2016-09-15 17:19:21.000000000 +0300
+++ osgearth-osgearth-2.8/src/osgEarthSymbology/GEOS 2017-02-02 19:43:19.103864300 +0300
@@ -26,6 +26,7 @@
#include <osgEarthSymbology/Style>
#include <osgEarthSymbology/Geometry>
#include <geos/geom/Geometry.h>
+#include <geos/geom/GeometryFactory.h>
namespace osgEarth { namespace Symbology
{
@@ -45,7 +46,7 @@
void disposeGeometry(geos::geom::Geometry* input);
protected:
- geos::geom::GeometryFactory* _factory;
+ geos::geom::GeometryFactory::unique_ptr _factory;
};
} } // namespace osgEarth::Features
diff -Naur osgearth-osgearth-2.8-orig/src/osgEarthSymbology/GEOS.cpp osgearth-osgearth-2.8/src/osgEarthSymbology/GEOS.cpp
--- osgearth-osgearth-2.8-orig/src/osgEarthSymbology/GEOS.cpp 2016-09-15 17:19:21.000000000 +0300
+++ osgearth-osgearth-2.8/src/osgEarthSymbology/GEOS.cpp 2017-02-02 19:44:46.772878700 +0300
@@ -67,7 +67,7 @@
}
geom::Geometry*
- import( const Symbology::Geometry* input, const geom::GeometryFactory* f )
+ import( const Symbology::Geometry* input, const geom::GeometryFactory::unique_ptr f )
{
geom::Geometry* output = 0L;
@@ -216,7 +216,7 @@
geos::geom::PrecisionModel* pm = new geos::geom::PrecisionModel(geom::PrecisionModel::FLOATING);
// Factory will clone the PM
- _factory = new geos::geom::GeometryFactory( pm );
+ _factory = geos::geom::GeometryFactory::create( pm );
// Delete the template.
delete pm;
@@ -224,7 +224,6 @@
GEOSContext::~GEOSContext()
{
- delete _factory;
}
geom::Geometry*
@@ -331,10 +330,7 @@
{
if (input)
{
- geom::GeometryFactory* f = const_cast<geom::GeometryFactory*>(input->getFactory());
_factory->destroyGeometry(input);
- if ( f != _factory )
- delete f;
}
}
|