summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fxjs/xfa/cjx_object.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/fxjs/xfa/cjx_object.h b/fxjs/xfa/cjx_object.h
index e21a3ef3f5..12b58b0af8 100644
--- a/fxjs/xfa/cjx_object.h
+++ b/fxjs/xfa/cjx_object.h
@@ -67,7 +67,7 @@ class CJX_Object {
size_t GetCalcRecursionCount() const { return calc_recursion_count_; }
void SetLayoutItem(CXFA_LayoutItem* item) { layout_item_ = item; }
- CXFA_LayoutItem* GetLayoutItem() const { return layout_item_.Get(); }
+ CXFA_LayoutItem* GetLayoutItem() const { return layout_item_; }
bool HasMethod(const WideString& func) const;
CJS_Return RunMethod(const WideString& func,
@@ -272,7 +272,13 @@ class CJX_Object {
void MoveBufferMapData(CXFA_Object* pDstModule);
UnownedPtr<CXFA_Object> object_;
- UnownedPtr<CXFA_LayoutItem> layout_item_;
+ // This is an UnownedPtr but, due to lifetime issues, can't be marked as such
+ // at this point. The CJX_Node is freed by its parent CXFA_Node. The CXFA_Node
+ // will be freed during CXFA_NodeHolder destruction (CXFA_Document
+ // destruction as the only implementation). This will happen after the
+ // CXFA_LayoutProcessor is destroyed in the CXFA_Document, leaving this as a
+ // bad unowned ptr.
+ CXFA_LayoutItem* layout_item_ = nullptr;
std::unique_ptr<XFA_MAPMODULEDATA> map_module_data_;
std::unique_ptr<CXFA_CalcData> calc_data_;
std::map<ByteString, CJX_MethodCall> method_specs_;