Commit Graph

89 Commits

Author SHA1 Message Date
wmayer
985def3416 Base: apply clang format 2023-11-13 12:01:26 -05:00
wmayer
13f30b2cbb Base: fix crash in PyException::ReportException() 2023-11-06 10:08:18 +01:00
Ed Williams
58c3e2a425 Base: set sys.last_vars to enable post mortem debugging after exception
* Update Interpreter.cpp to enable stack trace

This enables python debuggers to stack trace after an exception.
See https://forum.freecad.org/viewtopic.php?p=714349#p714349

Co-authored-by: bdieterm <119257544+bdieterm@users.noreply.github.com>
2023-10-31 09:40:57 +01:00
mosfet80
cb607ffe1e [BASE] Removed dead code (#10330) 2023-08-28 10:41:20 -05:00
wmayer
097d5d6fee Base: C++ core guidelines: init variables 2023-08-24 18:48:52 +02:00
wmayer
50af46b7c9 Core: modernize C++: return braced init list 2023-08-19 11:35:41 +02:00
wmayer
59760c723f Base: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
wmayer
31ed14db83 modernize C++: use noexcept 2023-08-07 16:06:58 +02:00
Abdullah Tahiri
624592fc8b Interpreter: Fix lack of notifier in DeveloperError call 2023-06-01 19:25:00 +02:00
Abdullah Tahiri
1b59b75482 Base: Interpreter - Mark Exception reporting and stack as intended for developers 2023-05-23 14:24:45 +02:00
wmayer
a8a6a7ac25 Fixes #8206: FreeCAD segfaults being run with parameters (e.g .desktop file has /usr/bin/freecad --single-instance) 2023-02-11 17:49:52 +01:00
marioalexis
be8b5f345c Base: Replace C cast 2022-09-18 11:06:51 -05:00
wmayer
d92eaf7a72 Base: fix several warnings reported by code analyzers 2022-08-02 13:04:50 +02:00
berniev
15419982d4 Base: Modernise ctors dtors defs etc 2022-08-02 12:37:46 +02:00
Uwe
61303b0a01 [Base] remove some more superfluous nullptr checks 2022-07-18 13:07:16 +02:00
Uwe
4b2ffd2eca [Base] remove superfluous nullptr checks 2022-07-18 03:16:22 +02:00
wmayer
55828c22c0 Py: make FreeCAD to compile with Py3.11 2022-07-01 17:54:50 +02:00
wmayer
f5235a8057 cppcoreguidelines-pro-type-union-access
According to https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md using union for type-punning is undefined behaviour.
 Replace it with std::memcpy
2022-06-24 14:29:50 +02:00
marioalexis
adfac77e61 Base: Add function to get Python object types for SWIG interfaces 2022-06-21 21:01:37 -04:00
Zheng, Lei
8bec44934b Fix mixed line endings 2022-04-26 12:52:55 -05:00
Chris Hennes
b5c72abee4 Base: PR6497 move return statement to new line 2022-03-29 12:34:34 -05:00
wmayer
4183c45a01 Base: modernize C++11
* use nullptr
2022-03-23 16:57:25 +01:00
wmayer
e50a475226 Base: [skip ci] cleaning up modules is only needed for leak detectors 2022-03-20 13:39:22 +01:00
wmayer
1f12dca2b4 Py: replace BaseExceptionFreeCADError with more suitable exception types 2022-03-17 13:54:23 +01:00
wmayer
b13284a221 Base: let interpreter keep track of created modules 2022-03-13 22:34:01 +01:00
wmayer
91e4e468dd Base: move ILogger sub-classes to their own source files in order to reduce including stream classes in client code 2022-03-06 10:13:47 +01:00
Uwe
38ea286f28 [Base] Geometry etc.: remove unused includes 2022-03-01 13:56:02 +01:00
Uwe
288ccdb004 [Base] fix typo to silence spellchecker CI 2022-02-22 02:31:51 +01:00
wmayer
e92325c9c9 App: remove some more deprecated Py2 code
and remove deprecated void from function signature and replace 0 or NULL with nullptr
2021-04-26 10:55:56 +02:00
wmayer
c563198b35 Base: remove some more deprecated Py2 code
and remove deprecated void from function signature and replace 0 or NULL with nullptr
2021-04-26 10:29:48 +02:00
luz paz
59b7e9fdd0 Base: remove Py2 code 2021-04-26 09:23:58 +02:00
wmayer
dd4dd204d0 App/Gui: fix memory leaks:
+ add function to cleanup units and quantities in debug build
+ fix reference leak in PropertyVector::getPyPathValue()
+ fix reference leak in PropertyPlacement::getPyPathValue()
+ in InterpreterSingleton::init() use a static std::vector<wchar_t*> instead of a C array
  to free memory at program end
+ in MainWindow::closeEvent() explicitly delete all task watchers
+ in ReportOutputObserver constructor pass parent to QObject
+ in PropertyEditor destructor explicitly delete QItemEditorFactory
2021-02-27 10:56:19 +01:00
wmayer
64fdf4c799 Py: [skip ci] replace PyList_Append with Py::List::append 2020-12-13 16:44:14 +01:00
luz paz
01b21e0d06 Base: Fix header uniformity, whitespace, and doxygen
[skip ci]
2020-11-22 18:12:16 +01:00
wmayer
27070858f0 Base: [skip ci] fix several -Wunused-parameter warnings 2020-11-06 08:15:44 +01:00
wmayer
42a723d172 Base: [skip ci] fix several -Wunused-parameter warnings 2020-11-06 08:14:00 +01:00
wmayer
a51d2bab99 Base: Py2 related fix 2020-09-04 19:02:29 +02:00
wmayer
6f7118850b Base: [skip ci] Various fixes in InterpreterSingleton::runStringWithKey:
+ fix memory leak (localDictionary) by replacing C API with PyCXX
+ don't write the whole code as error message if an error occurs. Python raises an exception with all relevant information for debugging
2020-09-04 09:58:21 +02:00
mwganson
69f43d7bf3 [CheckGeometry] fix segfault, reformat output with lower case, use try/except to check for runtime python errors and fall back on OCCT method if script failed. 2020-09-03 12:09:38 +02:00
mwganson
720668a7a5 [check geometry] decrement some pyobject references 2020-09-03 12:09:38 +02:00
mwganson
cf9118d249 [CheckGeometry] fix python2 build 2020-09-03 12:09:38 +02:00
mwganson
179d687f0e [CheckGeometry] fix py2 build failure 2020-09-03 12:09:38 +02:00
mwganson
3c19765c37 [CheckGeometry] update a source code comment 2020-09-03 12:09:38 +02:00
mwganson
ed3ff7db5e [CheckGeometry] add new shapecontent builder instead of OCCT's to correct some errors in OCCT's values and to add for some more advanced information, e.g. volume or area, add new method to Base::Interpreter runStringWithKey() -- allows to run a python script and get a string return value 2020-09-03 12:09:38 +02:00
wmayer
9367e73e92 LGTM: [skip ci] fix: Inconsistent definition of copy constructor and assignment ('Rule of Two')
Remove user-defined copy constructor of Exception classes without assignment operator
2020-07-27 13:47:41 +02:00
wmayer
88fd77b31d Porting Py3.8/Py3.9:
Since Py3.3: 'Py_ssize_t PyUnicode_GetSize(PyObject*)' is deprecated [-Wdeprecated-declarations]
Since Py3.9: 'PyObject* PyEval_CallObjectWithKeywords(PyObject*, PyObject*, PyObject*)' is deprecated [-Wdeprecated-declarations]
Since Py3.9: 'void PyEval_InitThreads()' is deprecated [-Wdeprecated-declarations]
2020-06-12 17:51:33 +02:00
luz.paz
ae72e2c762 Trivial code formatting for some {.cpp,.h} files 2020-04-06 12:55:27 +02:00
wmayer
5bfef75696 Base: [skip ci] add method to more easily set the Python error indicator from a Base::Exception 2020-03-18 17:53:13 +01:00
luz.paz
011e5aedfa src/Base: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/Base` files
2019-12-25 11:38:58 +01:00
asapelkin
875a463923 Used single quotes for single character in string::find algorithm, more efficient 2019-11-21 18:59:43 +01:00