Browse Source

Looking for memory leak, not found yet.

enhancement_3
Trevor Irons 7 years ago
parent
commit
9495039bef

+ 2
- 2
Modules/FDEM1D/CMakeLists.txt View File

@@ -23,8 +23,8 @@ endif()
23 23
 
24 24
 # Install
25 25
 install ( TARGETS fdem1d DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
26
-install ( FILES include/FDEM1D  DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/ ) 
27
-install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/  FILES_MATCHING PATTERN "*.h")
26
+install ( FILES include/FDEM1D  DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma ) 
27
+install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma  FILES_MATCHING PATTERN "*.h")
28 28
 
29 29
 #install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/  FILES_MATCHING PATTERN "FDEM1D")
30 30
 #install ( DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/FDEM1D  FILES_MATCHING PATTERN "*.h")

+ 2
- 2
Modules/FDEM1D/examples/EMDipEarth1D.cpp View File

@@ -99,7 +99,7 @@ int main() {
99 99
 	//std::cout << receivers->GetEfield(0) << std::endl;
100 100
 	//std::cout << receivers->GetHfield(1) << std::endl;
101 101
 	//std::cout << receivers->GetEfield(1) << std::endl;
102
-	receivers->ClearFields();
102
+	//receivers->ClearFields();
103 103
 
104 104
     // swap tx rx posigion
105 105
     /*
@@ -110,7 +110,7 @@ int main() {
110 110
 	receivers->ClearFields();
111 111
     */
112 112
 
113
- #ifdef KIHALEE_EM1D
113
+ #ifdef NOKIHALEE_EM1D
114 114
     std::cout << "\nFORTRAN\n";
115 115
  	EmEarth->MakeCalc();
116 116
 // 	std::cout << receivers->GetHfield(0,0) << std::endl;

+ 4
- 4
Modules/FDEM1D/include/KernelEM1DManager.h View File

@@ -147,10 +147,10 @@ namespace Lemma {
147 147
             std::vector< std::shared_ptr<KernelEM1DBase> >  KernelVec;
148 148
 
149 149
             /** Reflection base used for TE mode */
150
-            std::shared_ptr<KernelEM1DReflBase>        TEReflBase;
150
+            std::shared_ptr<KernelEM1DReflBase>        TEReflBase = nullptr;
151 151
 
152 152
             /** Reflection base used for TM mode */
153
-            std::shared_ptr<KernelEM1DReflBase>        TMReflBase;
153
+            std::shared_ptr<KernelEM1DReflBase>        TMReflBase = nullptr;
154 154
 
155 155
             /** EmEarth Class */
156 156
             std::shared_ptr<LayeredEarthEM>            Earth;
@@ -175,8 +175,7 @@ namespace Lemma {
175 175
     int KernelEM1DManager::AddKernel( ) {
176 176
 
177 177
         auto NewKern = KernelEM1DSpec<Mode, Ikernel, Isource, Irecv>::NewSP();
178
-        KernelVec.push_back( NewKern );
179
-        NewKern->managerIdx = KernelVec.size()-1;
178
+        NewKern->managerIdx = KernelVec.size();
180 179
         switch (Mode) {
181 180
             case TE:
182 181
                 if (TEReflBase == nullptr) {
@@ -197,6 +196,7 @@ namespace Lemma {
197 196
                 NewKern->SetReflBase(TMReflBase);
198 197
                 break;
199 198
         }
199
+        KernelVec.push_back( std::move(NewKern) );
200 200
         return static_cast<int>(KernelVec.size()-1);
201 201
      }
202 202
 

+ 1
- 1
Modules/FDEM1D/include/KernelEM1DReflBase.h View File

@@ -211,7 +211,7 @@ namespace Lemma {
211 211
 			EMMODE mode;
212 212
 
213 213
             /// Pointer to layered earth
214
-            std::shared_ptr<LayeredEarthEM> Earth;
214
+            std::shared_ptr<LayeredEarthEM> Earth = nullptr;
215 215
 
216 216
 			Complex       uk;
217 217
 			Complex       um;

+ 2
- 2
Modules/LemmaCore/CMakeLists.txt View File

@@ -32,8 +32,8 @@ endif()
32 32
 
33 33
 # Install
34 34
 install (  TARGETS lemmacore DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
35
-install ( FILES include/LemmaCore  DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/ ) 
36
-install ( DIRECTORY include/       DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/  FILES_MATCHING PATTERN "*.h" )
35
+install ( FILES include/LemmaCore  DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma ) 
36
+install ( DIRECTORY include/       DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma  FILES_MATCHING PATTERN "*.h" )
37 37
 
38 38
 # Examples
39 39
 if (LEMMA_BUILD_EXAMPLES)

Loading…
Cancel
Save